If you want to execute some Linux
command without leaving any trace to history file. You can execute
the command as below:
Method 1:
syntax:
alok@alok:~$ history -d $((HISTCMD-1) && linux_command
alok@alok:~$ history -d $((HISTCMD-1) && linux_command
Method 2:
By keeping some space at the beginning of the command we can avoid logging commands in history.
Note: This method is only applicable for Ubuntu OS.
Delete a particular command from history:
Now if you want to delete a particular entry from history then we can use the below command:
syantax:
alok@alok:~$ history -d $((HISTCMD-1)) && history -d line_number_of_command_in_history
Example:









This post is quite tricky one....its really nice one
ReplyDeleteAmazing !!
ReplyDeleteGreat information..:) thanx alot for sharing.. :)
ReplyDeleteVery effective
ReplyDeleteThanks guys for your comments.
ReplyDeleteKeep visiting...