Daily Shaarli

All links of one day in a single page.

September 1, 2020

How to write the output into the file in Linux - nixCraft
thumbnail

Les redirections de fichiers.
Un bon tableau dans l'article, voici un petit résumé des 2 plus utiles (déclinés en nouveau fichier / append) à mes yeux.

  • command > output.txt 2>&1: {POSIX} Puts both standard error and output to file named output.txt
  • command >> output.txt 2>&1: {POSIX} Appends both standard error and output to file called output.txt
  • command 2>&1 \| tee output.txt: {POSIX} Puts both standard output and error to file named output.txt while displaying output on terminal
  • command 2>&1 \| tee -a output.txt: {POSIX} Append both standard output and error to file named output.txt while displaying output on terminal