Viewing files

From LQWiki
Jump to navigation Jump to search

There's more than one way to skin a cat. And there's more than one way to view a file. Here are a few file viewing methods for the arsenal.

Text files

Most linux programs use text files for input, output, and configuration. Being able to view them easily is vital to using the system. Of course, any editor can also be used to view files.

Command-line (terminal) programs

  • cat - Displays the entire contents of a set of files to the screen.
  • head - Displays the top few lines of a file.
  • tail - Displays the last few lines of a file.
  • less - Displays a file page-by-page.
  • grep - Displays selected lines of input files.

Graphical (X windows) programs

  • xterm - Call with xterm -e less filename for a quick-and-dirty, portAble file viewer.
  • emacs - In emacs, the Ctrl-X Ctrl-Q sequence write-protects a buffer, if it isn't already. A percent sign (%) is displayed in the mode line (status bar) for protected buffers.

Graphics files

These include bmp, gif, JPEG, tiff, pcx, PNG, and countless other formats.

Video files

  • xanim

Other files

This article is a stub and needs to be finished. Plunge forward and help it grow!