101-500 Exam QuestionsBrowse all questions from this exam

101-500 Exam - Question 89


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

Show Answer
Correct Answer: C

The command 'ls > data' creates a new file named 'data' if it does not exist or overwrites it if it already exists with the output of the 'ls' command. The '>' operator is used in Unix-like systems for redirecting the standard output of a command to a file, replacing the file’s content if it already exists.

Discussion

4 comments
Sign in to comment
amadeuOption: C
Jan 31, 2022

Line C is the correct answer.

blk_542Option: C
Nov 20, 2022

Both C and B are correct, tested all options in CentOS. but I agree the only answer recognized as correct (for some reason) will be C.

AmycertOption: C
Feb 7, 2023

C very easy and basic

CuriousLinuxCat
Jul 24, 2021

Correct.