Living in the Shell #21; head (Display File Content From Beginning)
head
📜
Displays file content from beginning.
Print first N lines of a file -n
head -n 5 ~/.bashrc
Print all but N last lines -n -N
tail -n -3 ~/.bashrc
Print first N bytes of a file -c
head -c 1k ~/.bashrc
Prints first 1k of file binary content.
Print all but N last bytes -c -N
tail -c -1k ~/.bashrc
About Living in the Shell
Obsessed with doing things in the shell, I’ve decided to share my daily struggles on living in the shell as terse but informative posts.