How to delete 'n' number if commands executed from bash history

For deleting 'n' number of commands frm bash history,

first type history command in shell,

#history

for example if you need to delete commands from line 520 to line 637 . execute the command as follows.


#for h in $(seq 520 637 | tac); do history -d $h; done


thats it.

Comments

Popular posts from this blog

CDbConnection failed to open the DB connection mysql 8

/bin/sh^M: bad interpreter: No such file or directory Linux