• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Part III: Appendixes > Command Formatting

Command Formatting

Table D.6 lists the input/output redirection options. Multiple redirection options may be used on one command.

Table D.6. Redirection and Multiple Command Formats
Format Result
command >filename Directs output to file filename.
command >>filename Appends output to filename.
command <filename Command reads input from filename.
command 1>filename Redirects standard output (same as >).
command 1>>filename Appends standard output.
command 2>filename Redirects standard error.
command 2>>filename Appends standard error.
command 2>&1 Sends standard error to the same destination as standard output. Then, standard output can be redirected or piped.
command1 | command2 Standard output of command1 is piped to the standard input of command2.
command1 & command2 Multiple command run sequentially.
command1 && command2 Like &, but command2 is run only if command1 is successful (exits with error status 0).
command1 || command2 Opposite of &&; command2 is run only if command1 fails.
( command(s) ) Nests commands for if and for.
^x Escapes special character x.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint