Wednesday, 24 April 2013

Unix:Remove a command from History

You can remove a command from history as follows:

$history -d <offset>

For example,

$ history
1 cd /home
2 rm filename
3 ls -l
4 touch new
5 cp new new1
6 history

$ history -d 4

$ history
1 cd /home
2 rm filename
3 ls -l
4 cp new new1
5 history
6 history -d 4
7 history


No comments:

Post a Comment