File Viewing commands

cat - concatenate files. Takes a list of files and displays their
contents serially..

  • Used with redirection to create a consolidate file.
  • Used with piping to feed input into another command.
  • Can often be used instead of redirection, < when multiple files needed. cat stocks bonds | tr "," ":" > all. Options : more - file content browsing utility.
  • Allows user to control scrolling down the document.
  • Allows some searching.
  • But all movement is always forward. Can't backup.
  • Obsolete - replaced by less less - file content browsing utility.
  • Allows user to control scrolling up and down the document.
  • Allows searching using regular expressions in either direction.
  • Allows multiple files to opened and to move between them.
  • Can display binary files without crashing terminal. Won't be readable. See the man page on less. head - show the 1st 10 lines of a file[s] contents. Useful for checking the doc area of program files. If multiple file-names specified, prints header above each file's output. Options : tail - display last 10 lines of a file[s] contents. Useful for observing log files that are constantly growing. Options:
      -c n - display last n bytes rather than using line count. Takes scale modifiers. -n n - display 1st n lines. Takes scale modifiers. -q - doesn't print header. -f - follow - tail continues to run, updating display if changes occur. -t # - used with -f to set time between checks.
    Next