Bash and Linux 5 · Files and directories

Show the first lines

Print the first 20 lines of a file.

head -n 20 file.txt

Official Bash and Linux 5 documentation

More files and directories commands

All files and directories commands · Bash and Linux 5 cheatsheet

Was this page helpful?