• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to Remove/ Disable Bash shell Command History on Linux

by admin

This post will help you to remove/ disable Bash shell commands history on Linux.

1. Disable history for a current shell.

# set +o history

2. Clean command history.

# history -c

3. Permanently disable bash history.

# echo 'set +o history' >> ~/.bashrc

Next time when user login to the shell it will not store any commands to a history file .bash_history.

To apply this settings immediately for the current shell session execute the .bashrc file:

# . ~/.bashrc

4. Disable a command history system wide:

# echo 'set +o history' >> /etc/profile

It will be effective for the new users created after this.

Filed Under: Linux

Some more articles you might also be interested in …

  1. CentOS / RHEL : How to Disable / Enable direct root and non-root user ssh login
  2. namcap: command not found
  3. How to configure LDAP Client on CentOS/RHEL 6 using SSSD
  4. diff: command not found
  5. How to modify snmp service to listen to an alternative port in CentOS/RHEL
  6. grep: command not found
  7. getsebool Command in Linux
  8. service Command Examples in Linux
  9. engrampa: command not found
  10. Order of environment calls for different OS shells in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • qm Command Examples in Linux
  • qm wait Command Examples in Linux
  • qm start Command Examples in Linux
  • qm snapshot Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright