First page Back Continue Last page Overview Graphics
Reading Text Files from the Console
cat <filename> : dumps contents of file to screen
- Useful for quickly viewing small files
less <filename> : view a text file interactively
- Scroll up/down, search for text, etc.
vi <filename> : open a file for editing
Notes:
cat is an extremely versatile tool. Check out http://www-106.ibm.com/developerworks/linux/library/l-tiptex2.html for a few examples of creative “cat” usage.
tuxfiles.org also has a cat/less reference page.
less has been christened this way as a mockery of “more”, a traditional UNIX file viewer. The problem with “more” is that it could only increment the screen by a full page down the document. No going back up, no line-by-line scroll. So someone decided to scratch his itch, and write a better "more".