UNIX - Shell Special Symbols

UNIX - Shell Special Symbols

symboldescription
;

separate a sequence of commands

> cd ; ls
|

"pipe" - connects stdout of one program to stdin of another

> cat /etc/passwd | wc -l
<>

file redirection:

  • > redirects stdout to a file
  • < redirects stdin to a file

If file foo already exists, > foo overwrites it. If file foo already exists, >> foo appends new text to the end of the existing file

> cat /etc/passwd > foo.txt
> ls
foo.txt
> wc -l < foo.txt
218
$?gives value "returned" by the last shell program run
&run program in the background