QuestionQ21

Automation, Orchestration, and Scripting

An administrator must append the output from a Linux command to an existing file for later analysis. Which of the following command-line strings should the administrator use?

  • A cat ls > file.txt
  • B tcc ls > awk file.txt
  • C echo ls | sed -i file.txt
  • D ls >> file.txt
Explanation

The >> shell redirection operator appends a command’s standard output to the end of a file without overwriting its existing contents.

Community Discussion

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