File Viewing

cat

View files in their entirety

less

View files one page at a time

head

View the first lines of a file

tail

View the last lines of a file

nl

View files with their lines numbered

od

View data in octal (or other formats)

xxd

View data in hexadecimal

gv

View Postscript or PDF files

xdvi

View TeX DVI files

In Linux, you’ll encounter various types of files to view: plain text, Postscript, binary data, and more. Here we’ll explain how to view them. Note that commands for viewing graphics files are covered in Graphics and Screensavers, and audio files in Audio and Video.

Get Linux Pocket Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.