I got a message that I am running out of space, so I did du -h and figured that the /var folder was taking 176 GB space! I cleared away all the .gz (gzipped files) but still no improvement!
Asked
Active
Viewed 4,559 times
1
Lorenz Keel
- 8,362
- 8
- 36
- 49
Gargi Singh
- 11
- 1
- 2
-
3Please post the output of `ls -l /var/log`. And for the file that takes up space `tail -n 100
`. You probably need to find out what's spamming your logs with information (probably `syslog` or `kern.log`). – Artur Meinild Jul 27 '21 at 11:47 -
3See also [Very large log files, what should I do?](https://askubuntu.com/questions/515146/very-large-log-files-what-should-i-do) – steeldriver Jul 27 '21 at 12:04
-
To find out what is using up a lot of space: `sudo du | sort -n`. That aggregates on the directory level, whereas in your case it must be files, so `sudo du -a | sort -n` should give you the biggest consumers at the bottom. – zwets Jul 27 '21 at 12:10
1 Answers
0
Your du output shows that the space is occupied by files in /var/log itself, not in some subdirectory.
The next step would be to check that directory for excessively big files. This is most easily done by the command
ls -lS | head
which shows the nine biggest files in the directory in descending order.
If that doesn't solve the riddle yet then you can run the tail command on the biggest one to see its last ten lines.
These will very probably include one or more specimens of the message that's filling your disk.
Tilman
- 3,325
- 18
- 25
