Skip to main content
Ctrl+K

CodingNotes

  • quickstart
  • command line
  • HPC
  • python
  • simulation
  • More Notes !!
  • Google Scholar
  • GitHub
  • Twitter
  • Linkedin
  • quickstart
  • command line
  • HPC
  • python
  • simulation
  • More Notes !!
  • Google Scholar
  • GitHub
  • Twitter
  • Linkedin

Section Navigation

  • 2.1. bash
    • 2.1.6. Functions
    • 2.1.7. Loops
    • 2.1.8. DotFiles
  • 2.2. vi/vim: Text Editing
    • 2.2.4. install vim version 9+ on linux ubuntu 20+
    • 2.2.5. My dotfile
  • 2.3. git: Version Control
    • 2.3.4. Branching
    • 2.3.5. git Examples (CC-ATS)
    • 2.3.6. General Use Cases
  • 2.4. Commands
    • 2.4.1. awk
    • 2.4.2. cat
    • 2.4.3. cd
    • 2.4.4. chsh
    • 2.4.5. cp
    • 2.4.6. echo
    • 2.4.7. grep
    • 2.4.8. head
    • 2.4.9. help
    • 2.4.10. less
    • 2.4.11. ls
    • 2.4.12. lsblk
    • 2.4.13. lscpu
    • 2.4.14. man
    • 2.4.15. mkdir
    • 2.4.16. module
    • 2.4.17. mount
    • 2.4.18. mv
    • 2.4.19. pwd
    • 2.4.20. rm
    • 2.4.21. rsync
    • 2.4.22. sbatch
    • 2.4.23. scancel
    • 2.4.24. scp
    • 2.4.25. sed
    • 2.4.26. seq
    • 2.4.27. setfacl
    • 2.4.28. sinfo
    • 2.4.29. sort
    • 2.4.30. ssh
    • 2.4.31. ssh-keygen
    • 2.4.32. tail
    • 2.4.33. tar
    • 2.4.34. touch
    • 2.4.35. trap
  • 2. command line
  • 2.4. Commands
  • 2.4.8. head

2.4.8. head#

head prints the first lines of a file.

2.4.8.1. Common head usage#

  • Output the first 10 lines of a file:

head file.txt
  • output the last X lines of a file

head -n X file.txt 

previous

2.4.7. grep

next

2.4.9. help

  • 2.4.8.1. Common head usage

This Page

  • Show Source

© Copyright 2026.

Created using Sphinx 8.1.3.

Built with the PyData Sphinx Theme 0.16.1.