Free LPI 010-160 Actual Exam Questions - Question 14 Discussion
B tbh doesn’t work because -- is used to signal end of options, not to handle spaces, so it won’t fix the space issue. A and E are clean since they handle space correctly, either by quoting or escaping.
I think A and E are the right picks here. A uses single quotes around the filename which handles the space fine, and E escapes the space with a backslash which also works. B is tricky because "--" usually means end of options, but here it's followed by a filename with a space and no quotes, so that might cause issues. D’s backslash inside single quotes won't escape the space, so that one won’t work. C is invalid syntax with those vertical bars. So yeah, A and E make sense to me.
I agree C is out for sure because those pipes don’t fit here. B’s double dash stops option parsing but doesn’t fix the space problem, so it tries reading two separate files named “Texts” and “2.txt.” That means B won’t output the content correctly. So yeah, A and E are the ones that work because they handle spaces properly—A with quotes and E with the backslash escape. D tries to escape inside quotes, which won’t work either. So A and E are the safe bets.
It’s definitely not C since those pipes and vertical bars don’t make sense here. Between A and E, both clearly handle the space issue—A uses quotes, E uses the backslash escape. D tries to escape inside quotes, which usually doesn’t work in bash. B’s double dash stops options but doesn’t solve the space issue, so it tries reading two files separately, which won't output the whole file correctly. So A and E are the best picks here for showing the full content of that file.
B’s double dash should stop option parsing, but it doesn’t handle the space in the filename properly, so it likely treats “Texts” and “2.txt” as separate files. D uses a backslash inside quotes, which might not work.
Probably A and E, those handle spaces in filenames right.