View and Delete Recent Terminal Command (s) History in Ubuntu

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)

In Ubuntu, all the commands that you type in Ubuntu gets stored in a file called .bash_history in your ~/home folder. You can manually edit it using any text editor of your choice to remove specific terminal commands.

If you want to view or delete all the commands, try this:

To view: Open a terminal and type


To clear entire history: In a terminal type

history -c

If you want to search for a specific terminal command then in a termina press Ctrl+r and then start to type first few characters of the command you are searching for. Once the command shows up, hit enter to accept and execute that command.

You might also like

Search or Recall Commands Typed in Linux Terminal Whether you...
Linux Command to Fix Permissions for Files and Directories If you migrate...
Linux Terminal Hacks (Ubuntu 9.10, Fedora 12) These common...
Find Version of GRUB Bootloader (Legacy or GRUB2) in Ubuntu / Linux Planning on...

About the Author

has written 346 posts on this blog.

Meditating towards his "nerdvana", lifehacker is a teacher by the day and a nerdy blogger by the night. He lives to learn and yearns to learn living.

Write a Comment

Gravatars are small images that can show your personality. You can get your gravatar for free today!


Copyright © 2018 Hack Your Life!. All rights reserved.
Proudly powered by WordPress. Developed by Deluxe Themes