There are many ways to view files in GNU/Linux. One of the simplest command line tools for viewing files is cat
. The cat
command, short for concatenate, is actually intended for joining multiple files into one, but it works equally well for viewing text files.
The command is easy to use. Just enter cat filename
. For example, information about your computer's cpu is stored in /proc/cpuinfo, so if you want to view this file, just enter
cat /proc/cpuinfo
If you'd like to view the file with line numbers, enter
cat -n /proc/cpuinfo
Like I said, there are more ways to view text files from the command line which I'll cover in the future.
#
A variant of cat that I picked up recently and can be handy - it turns your cat around and has her face tail first. Try this example:
tac /proc/cpuinfo
#
Chris - Thanks for the tip. I hadn't heard of that one.
#