Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Like that of .txt or .html

share|improve this question

migrated from Feb 23 '10 at 8:48

This question came from our site for professional and enthusiast programmers.

easiest are cat, head, tail, tac (for reverse output)

less and more let you scroll the text files (less being more powerful)

you can also use text editors like nano, pico, vi, emacs

share|improve this answer

cat and less are good for this.

share|improve this answer

you can use cat, although its really meant for concatenation of files. more or less are 2 other tools you can use. Other's include awk, eg using awk

$ awk '1' file

using sed

$ sed -n '1,$p' file

using grep

$ grep "." file

using head/tail to display some parts of the file

$ head -1000 file
$ tail -1000 file

Tools aside, you can also use just the shell to display your file

while read -r line
  echo "$line"
done <"file"
share|improve this answer
thanks very much – King of Zhopa Feb 23 '10 at 8:27

Try cat , head or tail.

share|improve this answer

To Display the contents of a file use this command:


cat test.txt
share|improve this answer

For viewing HTML files you can also use lynx, links, elinks or w3m which are text-mode browsers. They can also be used to view .txt files.

share|improve this answer

Or, less or more. See the man pages for more information. :)

share|improve this answer

cat Works fine with txt or html. (or less or more if you want tosee it page by page) or any text ediotr... (vi, emcas, gedit...).

Also know that if it's a binary file it's may contain control char that will do some displeasing things with your terminal (like changing charset). If that happen use reset to put it back in sane state.

You can also use file on file before displaying it's content, the system will guess it's type (based on content not filename name) and show it to you.

share|improve this answer

file : Display the type of file cat : Display the content of the file and outputs it on stdout.

You can use vi, emacs command to edit the file in Unix environment. If you do not have expertise in using vi/emacs you might find it little difficult to edit the file.

If you have X11 enabled, You can use a number of Linux editors like gvim, kate, kwrite, kdevelop etc.

Kwrite is my personal favorite in Linux.

share|improve this answer

You must log in to answer this question.