How to delete bash terminal history upto certain no. of commands
i want to delete some say 10 previous commands in bash shell!! what shud i do??
|
Why would you be wanting to cover your tracks like that? :tisk:
|
Try editing ~/.bash_history. If that doesn't work, IDK. I think there is a way to get bash to not add it to history at all, but I don't recall exactly how it's done. I stumbled upon it once by accident...
|
Quote:
Bash history is usually stored in ~/.bash_history but it's location can be controlled by setting $HISTFILE The history file is only written when the shell exits, so you can delete the last ten lines from a history file but that might not be what you want. You can prevent anything from being written to the history file by setting the value of $HISTSIZE to 0. Or I guess you could set $HISTFILE to /dev/null. See also http://www.faqs.org/docs/bashman/bashref_106.html |
All times are GMT -5. The time now is 03:48 PM. |