Quantcast
Channel: How to delete history of last 10 commands in shell? - Stack Overflow
Viewing all articles
Browse latest Browse all 23

Answer by steveo'america for How to delete history of last 10 commands in shell?

$
0
0

A simple function can kill all by number (though it barfs on errors)

kill_hist() {    for i in $(echo $@ | sed -e 's/ /\n/g;' | sort -rn | sed -e 's/\n/ /;')    do            history -d $i;    done}kill_hist `seq 511 520`# or kill a few rangeskill_hist `seq 1001 1010` `seq 1200 1201`

Viewing all articles
Browse latest Browse all 23

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>