Quantcast
Viewing latest article 14
Browse Latest Browse All 23

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

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 latest article 14
Browse Latest Browse All 23

Trending Articles