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
- List files with details
- Create nested directories
- Copy a directory
- Move or rename a file
- Delete a directory
- Create a symbolic link
All files and directories commands · Bash and Linux 5 cheatsheet