0

My file /var/log is 110 GB and system tell me low disk space.

What should I do? Should I delete the log file I have tried?

$ sudo apt-get clean
$ sudo apt-get autoclean
$ sudo apt-get autoremove 

But doesn't work.

1 Answers1

0

That is a directory and those commands deal with installed packages. They are unrelated. logrotate can be used to remove, compress, and/ or send logs to your email. What you need is up to you. Learning how to read the man pages is very helpful and, yes, it does take some getting used to. Those files are very important, please do not just delete them. Read the man page (at the command prompt: $ man logrotate), search the internet and post back with what you think you want to type and get an explanation from someone about what it will do. Also read the apt-get manual page ($ man apt-get) to see what they both do, as a reference. And, the habit of typing 'whatever' into the command line can be hazardous to your computer and your sanity.

DMon
  • 16
  • thanks for your advice but i think i did some thing which may damage every thing i don't know..... in coming times i will take with your advice this what i did Delete all files:

    find /var/log -type f -delete ("Delete all .gz and rotated file find /var/log -type f -regex "..gz$" find /var/log -type f -regex "..[0-9]$" Try run command without "-delete", to test it.") and it make file size equal 16MB

    – Muhamad Nady Oct 06 '18 at 15:11
  • Muhamad, you did not damage anything. It is a simple matter of you having no log history. Unless you were in the middle of troubleshooting, using them for work, or school this is no big deal as the installation generates them all the time. And, maybe, instead of using a size to determine which ones to keep, try a time (number of days), compress the older ones, and store them in a backup. – DMon Oct 06 '18 at 15:21
  • 1
    thank you for telling me this now i can take my breathe i was horrified from damaging operating system :D thanks – Muhamad Nady Oct 06 '18 at 15:28