QuestionQ12

Shells and Shell Scripting

Which statement is true about the command ls > files when files does not already exist?

  • A The output of ls is printed to the terminal
  • B files is created and contains the output of ls
  • C An error message is shown and ls is not executed
  • D The command files is executed and receives the output of ls
  • E Any output of ls is discarded
Explanation

The > output-redirection operator creates the target file when it does not exist and redirects the standard output of ls into that file.

Community Discussion

No comments yet. Be the first to start the discussion!