Deprecated: Creation of dynamic property ET_Builder_Module_Comments::$et_pb_unique_comments_module_class is deprecated in /home/softcrea/public_html/wp-content/themes/Divi/includes/builder/class-et-builder-element.php on line 1425

Bash: Delete History in Terminal

by | Dec 11, 2018 | Bash, Devops, Shell | 0 comments

Written By Ola Ajibode

Sometimes while working on the terminal or commandline as you know it, the history becomes clogged with simple common commands like ls -al and you want to remove X number of lines to keep your history compact and relevant.  Here’s a simple command that works:

for i in {1..total_count}; do history -d start_from; done

This deletes a total of total_count  amount of history starting from line number start_from in your history.   Make your Shell clean again!

Usage:

for i in {1..40}; do history -d 1000; done

Enjoy.

Written By Ola Ajibode

undefined

Explore More Insights

Docker:  Stop all containers now!

Docker: Stop all containers now!

Docker has changed our world. A very useful component in the toolbox of any Software Engineer or perhaps, any forward-thinking company. What is Docker? Why Docker? and other questions relating to the topic starts here: Docker Sometimes, you are just too annoyed with...

read more

0 Comments

Submit a Comment