Labels

View file content with terminal

# cat file1
view the contents of a file starting from the first row [man]

# head -2 file1
view first two lines of a file [man]

# less file1
similar to 'more' command but which allows backward movement in the file as well as forward movement [man]

# more file1
view content of a file along [man]

# tac file1
view the contents of a file starting from the last line [man]

# tail -2 file1
view last two lines of a file [man]

# tail -f /var/log/messages
view in real time what is added to a file [man]