Skip to content

Latest commit

 

History

History
40 lines (28 loc) · 416 Bytes

shell.md

File metadata and controls

40 lines (28 loc) · 416 Bytes

Shell

Redirect stdout:

command > file
command 1> file

Redirect stderr:

command 2> file

Redirect stderr to stdout:

command 2>&1 file

Redirect stderr and stdout:

command > file 2>&1
command &> file # non-POSIX, i.e. less compatible

Clear a file:

:> file
true > file # same as above

Make file executable:

chmod +x <file>