OSETC TECH

Linux: Finding Out All large files

I would like to find all large files located under /usr directory on my linux operating system. How To find out all large files in linux system? this article will guide you how to finding out all large files.

You need to use linux find command and combie with others linux command or tools to get out all large files, such as: awk tool.

​Finding out All large files


To find all file that size is more than 10MB by issue the following command:

find / -type f -size +10M -exec ls -lh {} \; | awk '{print $9 "====>" $5}'

outputs:

[root@devops ~]# find / -type f -size +10M -exec ls -lh {} \; | awk '{print $9 "====>" $5}'

/boot/initramfs-0-rescue-d028c143166f4a4aab2318b32b9b35d5.img====>39M

/boot/initramfs-3.10.0-123.el7.x86_64.img====>17M

/boot/initramfs-3.10.0-123.el7.x86_64kdump.img====>17M

/dev/shm/pulse-shm-2603296743====>65M

/dev/shm/pulse-shm-4152478638====>65M

/dev/shm/pulse-shm-2492214053====>65M

/dev/shm/pulse-shm-2108041840====>65M

/dev/shm/pulse-shm-1715249868====>65M

/dev/shm/pulse-shm-972989635====>65M

/dev/shm/pulse-shm-3767301141====>65M

/proc/kcore====>128T

...

To find out all files that size is less than 10MB by issue the following command:

find / -type f -size -10M -exec ls -lh {} \; | awk '{print $9 "====>" $5}'

outputs:

[root@devops ~]# find / -type f -size -10M -exec ls -lh {} \; | awk '{print $9 "====>" $5}'

/boot/grub/splash.xpm.gz====>1.4K

/boot/grub2/device.map====>64

/boot/grub2/i386-pc/acpi.mod====>9.7K

/boot/grub2/i386-pc/date.mod====>2.1K

/boot/grub2/i386-pc/adler32.mod====>1.3K

/boot/grub2/i386-pc/datehook.mod====>1.8K

/boot/grub2/i386-pc/affs.mod====>5.6K

/boot/grub2/i386-pc/datetime.mod====>1.3K

/boot/grub2/i386-pc/afs.mod====>6.5K

/boot/grub2/i386-pc/disk.mod====>2.4K

/boot/grub2/i386-pc/ahci.mod====>16K

/boot/grub2/i386-pc/all_video.mod====>705

/boot/grub2/i386-pc/chain.mod====>3.5K

....

done..