Skip to main content
oops.
Source Link

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

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

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

kill_hist() {
    for i in `echo $@ | sort | tac`
    do
            history -d $i;
    done
}
kill_hist `seq 511 520`
# or kill a few ranges
kill_hist `seq 1001 1010` `seq 1200 1201`

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 ranges
kill_hist `seq 1001 1010` `seq 1200 1201`
Source Link

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

kill_hist() {
    for i in `echo $@ | sort | tac`
    do
            history -d $i;
    done
}
kill_hist `seq 511 520`
# or kill a few ranges
kill_hist `seq 1001 1010` `seq 1200 1201`