-2

All discussions I read about report on commands to list large files on all the system. None of them helped me to solve the problem.

I have a half full root/

root@C:~#   df -Th
File system    Tipo      Dim. Usati Dispon. Uso% Mounted on
udev           devtmpfs  3,9G     0    3,9G   0% /dev
tmpfs          tmpfs     789M  9,6M    779M   2% /run
/dev/sda8      ext4       19G  9,8G    7,6G  57% /
tmpfs          tmpfs     3,9G   66M    3,8G   2% /dev/shm
tmpfs          tmpfs     5,0M  4,0K    5,0M   1% /run/lock
tmpfs          tmpfs     3,9G     0    3,9G   0% /sys/fs/cgroup
/dev/sda1      vfat      496M   65M    432M  14% /boot/efi
/dev/sda9      ext4      421G  108G    292G  27% /home
tmpfs          tmpfs     789M  108K    789M   1% /run/user/1000

However:

root@C:~# du -sch /root/*
68K /root/dmesg.txt
68K totale

There are hidden directories though:

root@C:~# echo .[^.]*
.aptitude .bash_history .bashrc .cache .config .dbus .gnupg .local .nano .profile .ssh .synaptic .wget-hsts

What is the command to get a proper list of them, to list all the heavy files and delete them?

Py-ser
  • 697

1 Answers1

-1

Try this one (from path /root)

find $PWD -xdev -ls | awk '{print $7" \t"$11}' | sort -rn | less

It will show you all files at your current directory sorted from bigger ones to smaller ones.

dessert
  • 39,982
  • This breaks on file or directory names with whitespaces. Btw, find $PWD isn't really necessary, find uses $PWD by default if no other path is given. A better alternative would be du -ah . | sort -nr | less. – dessert Feb 09 '18 at 08:25
  • 1
    @dessert When using du -h I also suggest using sort -h. – PerlDuck Feb 10 '18 at 11:42