It's an IO redirection operation. You have :
stdin 0
stdout 1
stderr 2
in UNIX world,
You can redirect output of the your command to a file. such as:
ls -l > myfile.txt
Above command used stdout.
or :
ls -l >> myfile.txt
Above command doesn't overwrite a file; it just appends to end of the file, or creates it if it doesn't exist.
Many commands have standard error: if you want to redirect standard error you just use 2>
Suppose, you want to read a file for which you don't have permission. It's a error. If you are a normal user, use:
cat /etc/passwd 2> myerror.txt
Sometimes you want to redirect standard error and standard out to the same place. You may for example:
ls -R /etc 2>&1 > myoutputanderrors.txt
But Your Answer:
Redirection of output causes the file whose name results from the expansion of word to be opened for writing on file descriptor n, or the standard output (file descriptor 1) if n is not specified. If the file does not exist it is created; if it does exist it is truncated to zero size.
The general format for redirecting output is:
[n]>[|]word
If the redirection operator is ‘>’, and the noclobber option to the set builtin has been enabled, the redirection will fail if the file whose name results from the expansion of word exists and is a regular file. If the redirection operator is ‘>|’, or the redirection operator is ‘>’ and the noclobber option is not enabled, the redirection is attempted even if the file named by word exists.
>|at: stackoverflow.com/questions/818255/in-the-bash-shell-what-is-21/… – F. Hauri Jan 7 at 14:31