Hapus Log aktivitas di ubuntu

If you want to delete your bash history, there are a few options you have.  First you must understand that the history of your bash session is stored into RAM and then written to ~/.bash_history when you log out of the bash session.  So even if you delete the ~/.bash_history file, your current bash session will still be written to history once you log out.

To delete the bash history for your current session as well as old sessions, you should do two things:

Delete the .bash_history file:

# rm -rf ~/.bash_history

Clear the current history stored in RAM:

# history -c

Stop writing to .bash_history for good

If you don’t want to log any history for good, you can do one of two things; turn it off for all users, or turn off logging history for a single user.

Turn off bash history for all users:

Append “unset HISTFILE” to /etc/profile:

# echo "unset HISTFILE" >> /etc/profile

Turn off bash history for a specific user:

Append “unset HISTFILE” to /home/USER/.bash_profile:

# echo "unset HISTFILE" >> /home/USER/.bash_profile

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s