Software Development Degree BTO120 Lecture Notes - Lecture 3: Symbolic Link, Temporary File, System Administrator
Document Summary
Standard input, output, and error for commands are sent to your terminal, unless they are redirected. Cat - (by itself) will take input from terminal (use control-d to end input), send output and error messages to terminal. > will redirect standard output to a file, deleting any existing contents of the file. Cat > temp - will redirect output to a file called temp. >> will redirect standard output to a file, but will append (add to) the end of the file. Cat temp >> temp2 - will append the contents of temp to the contents of temp2. 2> will redirect standard error to a file (note that > is the same as 1> ) 2>> will append standard error to a file. >&2 (or 1>&2 ) - will redirect standard output to standard error. >/dev/null will redirect output to a null file, to get rid of unwanted output. /dev/null can also be used to empty a file.