Simple redirection

Syntax

command > file

Send the output of command to file. This overwrites an existing file or creates a new one.

command >> file

Send the output of command to file. This appends to an existing file or creates a new one.

command < file

Take the input for command from file, which is opened for reading only.

command << text
command <<< word
command <> file

Take the input for command from file, which is opened for reading and writing on the standard input.

command >| file

2020–07–11