Next: File Permissions Up: UNIX Plumbing Previous: Using pipes

Non-destructive redirection

Using ``>'' to redirect output to a file is destructive: in other words, the command

/home/larry/papers#ls > file-list
overwrites the contents of the file file-list. If, instead, you redirect with the symbol ``>>'', the output will be appended to the named file, instead of overwriting it.
/home/larry/papers#ls >> file-list
will append the output of the ls command to file-list.

Just keep in mind that redirection and using pipes are features provided by the shell-the shell provides this handy syntax using ``>'' and ``>>'' and ``|''. It has nothing to do with the commands used themselves, but the shell.


abraham@iesd.auc.dk