Halloween Special 2026! Get Up to 25% OFF Practice Questions! Limited Time - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

LPI 101-500 Exam - Topic 1 Question 97 Discussion

Posted by Kris on Sep 14, 2024 at 08:49 PM

Which of the following command lines creates or, in case it already exists, overwrites a file called data with the output of ls?

Suggested Answer: A, E

Get Premium 101-500 Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
29 comments · newest first
RO
Rocco 11 months ago
Are you sure C is right? Seems too simple.
SU
Susana 11 months ago
Wait, I didn't know D just appends! That's interesting.
TI
Tiera 11 months ago
C is the correct one, no doubt about it!
GE
Gerald 12 months ago
I thought it was A at first, but that's for errors, right?
CE
Ceola 12 months ago
Definitely C, that's how you overwrite a file.
AF
Afton 12 months ago
I might be mixing things up, but I think "ls > data" is definitely the command that creates or overwrites the file.
LE
Leila 1 year ago
I'm a bit confused about the difference between ">" and ">>". I feel like ">>" appends, but I can't recall the exact details.
CA
Candida 1 year ago
I remember practicing a similar question, and I think "ls > data" is the right choice for creating or overwriting.
LO
Lorrie 1 year ago
I think the command to overwrite a file is the one with a single greater-than sign, but I'm not entirely sure.
RA
Rana 1 year ago
I'm not totally sure about this one. The different redirection operators like '>', '>>', and '>&' can be tricky. I'll need to double-check my notes on how they work before answering.
FR
Fredric 1 year ago
Okay, I got this. The key is that we want to create or overwrite the file 'data' with the output of 'ls'. So the correct answer is C, 'ls > data', because that will redirect the output to the file, creating or overwriting it as needed.
MA
Maryrose 1 year ago
Hmm, I'm a bit confused. Is it really that simple? I feel like there might be some nuance I'm missing here. Let me think this through a bit more carefully.
LO
Lonna 1 year ago
I'm pretty sure the answer is C. The '>' symbol redirects the output of the ls command to the file 'data', overwriting it if it already exists.
LO
Lorrie 1 year ago
This question seems straightforward, but I want to make sure I understand the context before answering.
TA
Tamala 1 year ago
Option D, of course! Gotta love those double-angle brackets, they make me all warm and fuzzy inside.
SH
Sherita 1 year ago
I'm feeling lucky, let's go with option B! Wait, is that the right command for Google?
FE
Felicitas 1 year ago
Hmm, I'm a bit unsure about this one. I might have to consult the man pages to be sure.
WH
Whitley 1 year ago
I'm going with option D, it will append the output of ls to the file data instead of overwriting it.
LI
Linn 1 year ago
↳ replying to Whitley
I think option B is the correct one, it redirects both standard output and standard error to the file data.
LY
Lynelle 1 year ago
↳ replying to Whitley
I agree with option D, it will append the output of ls to the file data instead of overwriting it.
RO
Rolland 1 year ago
↳ replying to Whitley
I'm not sure, but I believe option A is the right choice, it creates or overwrites the file data with the output of ls.
LO
Lottie 1 year ago
↳ replying to Whitley
I think option C is the correct one, it will overwrite the file data with the output of ls.
JI
Jill 1 year ago
Option C looks good to me, it will create or overwrite the file data with the output of ls.
CL
Clay 1 year ago
↳ replying to Jill
Yes, option C is the one that creates or overwrites the file data with the output of ls.
LA
Lavonna 1 year ago
↳ replying to Jill
I think you're right, option C is the correct command line for that.
VA
Van 1 year ago
↳ replying to Jill
Option C looks good to me, it will create or overwrite the file data with the output of ls.
TI
Timmy 2 years ago
I'm not sure, but I think D) ls >> data appends the output of ls to the file instead of overwriting it.
NA
Natalie 2 years ago
I agree with Royce, using > will create or overwrite the file with the output of ls.
RO
Royce 2 years ago
I think the answer is C) ls > data.
0/2000 characters

Save Cancel