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 6,963 times
1

Lorenz Keel
- 8,905

Gargi Singh
- 11
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,599
- 21
- 27
ls -l /var/log
. And for the file that takes up spacetail -n 100 <filename>
. You probably need to find out what's spamming your logs with information (probablysyslog
orkern.log
). – Artur Meinild Jul 27 '21 at 11:47sudo du | sort -n
. That aggregates on the directory level, whereas in your case it must be files, sosudo du -a | sort -n
should give you the biggest consumers at the bottom. – zwets Jul 27 '21 at 12:10