Sunday, July 16, 2017

# centos # histignore logging linux

How to use HISTIGNORE in Linux

Generally, to ignore repetitive commands used by user, for example exit or ls we utilize the HISTIGNORE utility which is added into the user's bash_profile

Here is an example on how to remove the word exit from user's history logging

First we cd into user tim's home directory as root

Then we make a backup copy of his bash_profile

We add the to-ignore word, save and quit with vi editor

To test the success of the change, su into tim and run exit command. Login again as tim and run the history command

You will now see that exit command is no longer recorded into user's command history logging

I am using CentOS for this test

No comments:

Post a Comment