Redirection and text processing · Question 8 of 12

What does ls > list.txt do if list.txt already exists?

1 answer is correct. Easy Created with AI

Show answer

Answer

  • D The output of ls overwrites the previous contents

Explanation

> redirects standard output to a file and empties it first. Appending would be >>, and screen plus file at the same time needs tee.

Certifications & exams

Which exam comes next?

You can already practise for 51 exams, and 16 are up for a vote. See all certifications with their official information, cast your vote or suggest your exam.

See all certifications