Creating Shell Commands

The shell recognizes a number of special characters on the command line. This section shows how to use these characters to do the following:

  • Send a program's output to a file.

  • Have a program read text from a file.

  • Append a program's output to a file.

  • Run a program in the background.

Using the >, >>, and < Redirection Operators

Shell redirection operators are used to direct a program's input and output. The shell can be used to feed a program input from another application, from the command line, or even from another file. These operators are used to copy, create, or overwrite files; to build reports; or to create databases.

The cat (short for concatenate) command is used to print one or more files to your display. ...

Get Practical Linux now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.