Skip to main content

Command Palette

Search for a command to run...

Living in the Shell #21; head (Display File Content From Beginning)

Updated
โ€ข1 min read
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

More from this blog

Babak K. Shandiz's Blog

43 posts