Redirections

Redirections change the source or destination of a command's data. > writes the output to a file, overwriting it, >> appends to the end, < reads input from a file and 2> redirects error messages. They let you keep or process results.

Example

ls > liste.txt
echo 'end' >> liste.txt
commande 2> erreurs.log

Related concepts

The whole glossary