Disk space in tmp directory in Linux

We can use du command to check the space in tmp directory or any other directory in Linux by using some other additional parameters. The below commands can be used to display the free space not only in tmp directory but also ni other directories

##By using du command
du -sh /tmp/* | sort -h

##if you need it by reverse chronological order
du -sh /tmp/* | sort -hr

##Another easiest way is 
du -sch * .[^.]* | sort -hr

The above commands will not only the list if tmp directory is full, it would also list the other directories and the space occupuied by them as shown below.


You may also like...