DEV Community

Cover image for Living in the Shell #21; head (Display File Content From Beginning)
Babak K. Shandiz
Babak K. Shandiz

Posted on β€’ Originally published at babakks.github.io on

3 2

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
Enter fullscreen mode Exit fullscreen mode

Print all but N last lines -n -N

tail -n -3 ~/.bashrc
Enter fullscreen mode Exit fullscreen mode

Print first N bytes of a file -c

head -c 1k ~/.bashrc
Enter fullscreen mode Exit fullscreen mode

Prints first 1k of file binary content.

Print all but N last bytes -c -N

tail -c -1k ~/.bashrc
Enter fullscreen mode Exit fullscreen mode

Top comments (1)

Collapse
 
sso profile image
Sall β€’

Nice, simple and useful πŸ‘
If you ever start a "Living in a Z Shell" and will look for ideas let me know πŸ˜ƒ
Also I am looking for collaborators to make the project and it's wiki new user friendly.

Billboard image

Try REST API Generation for Snowflake

DevOps for Private APIs. Automate the building, securing, and documenting of internal/private REST APIs with built-in enterprise security on bare-metal, VMs, or containers.

  • Auto-generated live APIs mapped from Snowflake database schema
  • Interactive Swagger API documentation
  • Scripting engine to customize your API
  • Built-in role-based access control

Learn more

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay