Viewing File Contents
catConcatenates two files together, then prints content to STDOUT.
Colloquially, it's used to print out the contents of a single file.
# Start in ~/unixclass
cd ~/unixclass
cat arrayDat.txtheadBy default, prints the first 10 lines of a file to STDOUT.
You can pass the
-nflag to specify the number of lines to print.
# Start in ~/unixclass
cd ~/unixclass
# Print the first 10 lines of arrayDat.txt
head arrayDat.txt
# Print the first 5 lines of arrayDat.txt
head -n 5 arrayDat.txttailBy default, prints the last 10 lines of a file to STDOUT.
You can pass the
-nflag to specify the number of lines to print.
lessLets you page through a long file or stream of text a.k.a. you can scroll.
Exit by pressing
q
Last updated
Was this helpful?
