Created
August 9, 2013 06:41
-
-
Save i3zhe/6191614 to your computer and use it in GitHub Desktop.
When accidentally pasting a file into the shell it puts a ton of ugly nonsense entries in the bash history. Is there a clean way to remove those entries?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rmhist() { | |
start=$1 | |
end=$2 | |
count=$(( end - start )) | |
while [ $count -ge 0 ] ; do | |
history -d $start | |
((count--)) | |
done | |
} | |
rmhist 800 1000 # will remove history from line 800 to 1000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment