16

In what folders are the logs and key histories stored so that I may make a script to purge them. Is there a specific folder for the hibernation partition or a file by which it keeps the RAM data on hibernate? Is someone wanted to rid of all command history/program load history/program execution history, where would they go?

Thankx Light

4 Answers 4

11

There are a lot of places where things get logged, and it will be very diffucult to be exhaustive, depending on what applications you use. That said, here are the main places I can think of:

  • most system logs go into /var/log
  • firefox stores your history, cookies, etc... in ~/.mozilla/firefox This can be purged from Firefox (shift+ctrl+suppr)
  • zeitgeist is an history daemon, that populates the dash recent history. It can be purged from the privacy settings
  • terminal command history is saved on a per-user basis in ~/.bash_history Deleting this file will remove this history.
  • gnome applications (gedit, nautilus, etc...) store recently used files in ~/.local/share/recently-used.xbel This file can be deleted if needed.

These are the main places I can think of, but any application can log things in various places... so it really depends on what logs you want to remove.

As mentionned by MrVaykadji, BleachBit is a GPL software that automates such cleansing task, and let you delete "log files" for a wide variety of known softwares. You can also easily add new cleaners with simple xml files. Might be what you are (ware) looking for!

4
  • I don't know if it is recommended, but I think BleachBit could be an "easy" solution for logs on mainstream programs.
    – MrVaykadji
    Feb 1, 2014 at 11:12
  • @MrVaykadji this is certainly an interesting to know project! Source code is available, and so called cleaners xml files give us a lot of information on various softwares. I'll update my answer to include this! Thanks a lot.
    – alci
    Feb 3, 2014 at 10:03
  • It also is a powerful tool, enough powerful to delete the wrong files and compromise your system. But maybe it is well coded and secure, I don't know.
    – MrVaykadji
    Feb 3, 2014 at 18:09
  • It seems that BleachBit will dry run and output a list of to-be-deleted files, before actualy deleting... But surely it must be used with caution.
    – alci
    Feb 4, 2014 at 14:20
10

It is located in: ~/.bash_history

0
5

Your bash history file is in your home directory: /home/your-user-name/.bash_history

Zeitgeist user history is stored in ~/.local/share/zeitgeist.

To reset the Zeitgeist history, open a terminal and copy/paste the following commands:

rm ~/.local/share/zeitgeist/activity.sqlite

Or navigate to that directory in Nautilus or your file manager and manually delete the sqlite database "activity.sqlite". It will be created again by Zeitgeist minus your previous user history.

I do not feel comfortable telling users to use some commands unless they understand the command completely and are careful to double check that the command is written correctly, especially any command beginning with rm since a user could easily do irreparable damage to their system if the command was incorrectly formatted, but to better answer the OP's question as suggested in comments, the system logs are stored in var/log But I have heard of people causing problems by deleting subdirectories inside the log directory as is mentioned here Can I delete /var/log files due to low root space?

But keep in mind that if you need to troubleshoot some system problem the logs will be very useful.

You can delete the contents of the journal folder by opening a terminal and copy and paste the following command:

sudo rm /var/log/journal/*

To see how much space it is using on your computer you can open a terminal and issue the query:

journalctl --disk-usage

My system is currently is using 3.9GB.

2
  • 1
    That only refers to the terminal history. You should edit your answer with a way to remove Ubuntu Logs, as asked (hint: Zeitgeist is also one of the logs to clean)
    – MrVaykadji
    Feb 1, 2014 at 10:32
  • Yes you are right. Sorry for the incomplete answer and I did not even mention var/logs, I forgot about zeitgeist because for the past several years I always disable zeitgeist and use gnome flashback / metacity even on this new 18.04 (Bionic) computer and in fact it was one of the first things I did after a clean install when Trusty reached EOL so I had forgotten about Zeitgeist. I see this answer was already edited for clarity by MrVaykadji. Thanks!
    – Stanwmusic
    Nov 30, 2019 at 11:20
0

It has to be taken under consideration that other than the logs mentioned above, many (if not most) applications keep their own individual logs in different locations. So as mentioned by alci, the answer really depends on what you want to sanitize.

Also it would be wise that, if the need does really exist you may want to try out your script writing skills to automate based on actual, specific needs of log sanitizing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.