Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

But you're on a command line, so you don't have a handy GUI program you can use, like Notepad on Windows or TextEdit on Macs. So you'll need to usually use a Linux command to view text.

...

A key to text manipulation is understanding Unix streams. Every command and Unix program has three "built-in" streams: standard input, standard output and standard error

Image RemovedImage Added


Most programs/commands read input data from some source, then write output to some destination. A data source can be a file, but can also be standard input. Similarly, a data destination can be a file but can also be a stream such as standard output.

The power of the Linux command line is due in no small part to the power of piping. The pipe operator ( | ) connects one program's standard output to the next program's standard input.

piping.pngImage RemovedImage Added


The key to the power of piping is that most Unix commands can accept input from standard input instead of from files. So, for example, these two expressions appear equivalent:

...