Could someone please tell me the difference between the different piping characters e.g |, >>, >
Thanks Ray Booysen
| is the "pipe" character that sends the standard output from one program into another (a "pipeline"). So, for example: ps -ef | grep sshd Will run the output from "ps -ef" into the input stream of grep that will look for "sshd" and print any lines it finds. ">" is the standard out redirection metacharacter. The standard output will be written to the file named after the ">" character. Example: ps -ef >psoutput Will run ps -ef and instead of displaying it on your console will write it to psoutput, overwriting it if it already exists (unless you don;t have permissions allowing this, or you use "noclobber" or equivalent in your shell". ">>" is the same as ">" EXCEPT it appends output to the file if it already exists, otherwise it works the same as ">". -- Regards Cliff
participants (1)
-
Cliff Sarginson