Redirection is a feature in Unix where the data from the standard out put or a file,so on.can be redirected i.e divert to a file or a program and vice versa.
redirection in UNIX it changes standard input in standard output we can redirect our files accordingly as $cat my > you so here i have redirected file (me) to u actually wt have done is i have change the standard input as well as standard output here standard input is file MY and standard output has been converted to file YOU by default standard o/p is monitor and standard i/p is keyboard so check it $cat my>you
redirection is used to change the default input and output source.
'>' is used to redirect the output to location other than standard output terminal. If the location doesn't exist it will create one and clean the previous content before writing the output.
'>>' is used to append the output to location other than standard output terminal. If the given location doesn't exist it will create one and append the output.
'<' is used to redirect the input from source other than standard input device.
Whenever we run a command on shell prompt we get some output on shell prompt. In case we don't want to appear the output on the shell prompt we can redirect the output to the somewhere else. We can make the output which go into the file or may be directly to printer or we could make it disappear.
This is known as redirection.
$ ls > listing
The ' ls ' command would normally give you a directory listing. Since you have the ' > ' operator after the ' ls ' command, redirection would take place. What follows the ' > ' tells Unix where to redirect the output. In our case it would create a file named ' listing ' and write the directory listing in that file. You could view this file using any text editor or by using the cat command.
Note: If the file mentioned already exists, it is overwritten. So care should be taken to enter a proper name. In case you want to append to an existing file, then instead of the ' > ' operator you should use the ' >> ' operator. This would append to the file if it already exists, else it would create a new file by that name and then add the output to that newly created file.