How do I use the cat command in Linux?

Last updated: March 28, 2011

The cat command in Linux allows you to view the contents of a file.

To use the cat command just use the following syntax:

# cat /some/directory/filename

For a very long file you will end up viewing the very end so you may wish to view it with more control with the pipe command and the less or more command.

Like this

# cat /some/directory/filename | less

# cat /some/directory/filename | more

Tags: linux, bash, cli