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 :
-A, -vet - show all non-printable characters.
-n - number all lines.
-b - number only non-empty lines. Note, tabs and spaces are non-empty.
-v - show non-printable, except for linefeed and tab.
-ve, -E - display $ at end of line. Useful for finding strays.
-vt, -T - display tabs as ^I. Useful for distinguishing between tab and spaces.
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 :
-c n - display 1st n bytes rather than using line count.
Takes scale modifiers, so -c 2k prints 1st 2000 lines.
-n n - display 1st n lines.
Takes scale modifiers.
-q - doesn't print header.
-v - always print header, even for single file.
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