Run Commands without saving into history [LINUX]

November 4, 2011, Posted by Vedank at 6:54 pm | No Comments


Bash ShellHello guys ! Do you know, how can we execute the command on a bash shell without saving into the history! If you want to do some work on your own computer or logged on to the others pc, you want to hide the things what you have done so far, just modify simple settings before the starting of your work.

Here are the Steps :

Steps1.  While working on a shell, just check the value of  HISTCONTROL variable by echo $HISTCONTROl, if it is not set to “ignorespaces”,then set HISTCONTROL=ignorespaces

  • user@Desktop# date
    Wed Nov 2 14:41:11 IST 2011
  • user@Desktop# touch coolbizz
  • user@Desktop# history
    1  date
    2  touch coolbizz
    3  history
  • user@Desktop# echo $HISTCONTROL [Press ENTER]
  • user@Desktop# HISTCONTROL=ignorespaces [Press ENTER]
Steps2. Now if you want to execute the command without saving into the history, then give space before the command.
  • user@Desktop# [SPACE] date[Press ENTER]
    Wed Nov 2  14: 52:10 IST 2011
  • user@Desktop#[SPACE]history[Press Enter]
    1  date
    2  touch coolbizz
    3  history
now you are done!

No comment yet.

Leave a Reply