• Home
  • Disclaimer
  • Contact
  • Archives
  • About
  • Subscribe
  • Support
  • Advertise

Kernel Talks

Unix, Linux, & Cloud!

  • How-to guides
    • Howto
    • Disk management
    • Configurations
    • Troubleshooting
  • OS
    • HPUX
    • Linux
  • Miscellaneous
    • Software & Tools
    • Cloud Services
    • System services
    • Virtualization
  • Certification Preparations
    • AWS Certified Solutions Architect – Associate
    • AWS Certified Solutions Architect – Professional
    • AWS Certified SysOps Administrator – Associate
    • AWS Certified Cloud Practitioner
    • Certified Kubernetes Administrator
    • Hashicorp Certified Terraform Associate
    • Oracle Cloud Infrastructure Foundations 2020 – Associate
  • Tips & Tricks
  • Linux commands
You are here: Home / Linux

Highest size files in mount point

Published: March 16, 2016 | Modified: June 20, 2020



Search for the highest sized file in the mount point. Useful while dealing with full mount points and cleaning up files to free up space.


There are many instances in the life of sysadmin when his system starts throwing filesystem full events and its headache to search culprit. Here we are going to see a command to search and display files with high utilization in a mount point. This is very useful to dig down and target exactly huge/big files rather than wasting time on trimming/deleting small files.

For example, if you are facing /tmp is full. Below is the command to search for large files in the given mount point. Here we are using du i.e. disk usage command then sorting the output list in reverse order so that the highest size files come to the top. Then getting top 10 to display as a result.

# du -a /tmp | sort -nr  | head -n 10
3396448 /tmp
1801984 /tmp/Acasrro411704
994848  /tmp/software.depot
81088   /tmp/PACPTHP_00001.depot
77088   /tmp/OraInstall2008-03-19_09-39-20AM
76912   /tmp/OraInstall2008-03-19_10-15-28AM
76848   /tmp/OraInstall2008-03-19_09-39-20AM/jre/1.4.2
76848   /tmp/OraInstall2008-03-19_09-39-20AM/jre
76656   /tmp/OraInstall2008-03-19_10-15-28AM/jre/1.4.2
76656   /tmp/OraInstall2008-03-19_10-15-28AM/jre

Replace /tmp with a mount point of your choice while running it in your system.

There are also different ways you can trace the highest size hogger on a mount point. Below are few

To find the large file size above 5000

# find /var -xdev -size +5000
/var/opt/perf/datafiles/logglob
/var/opt/perf/datafiles/logproc
/var/opt/perf/datafiles/logdev
/var/opt/perf/datafiles/logtran
/var/opt/OV/log/SPISvcDisc/DBSPI_ORACLE_UNIX_discovery.trc
/var/opt/OV/log/osspi/osspi.log
----- output truncated -----





Top 10 large directories in the mount point 

# du -kx /var | sort -rn -k1 | head -n 10
6726048	/var
3962830	/var/opt
3471340	/var/opt/OV
2494362	/var/adm
2465390	/var/opt/OV/tmp
1512210	/var/opt/OV/tmp/OpC
1438642	/var/adm/openv/logs
1438642	/var/adm/openv
921030	/var/adm/sa
822672	/var/adm/openv/logs/bpdbm

Top 10 large files in the mount point

# find /var -type f -xdev -print | xargs -e ll | sort -rn -k5 | head -n 10
-rw-rw----   1 root       bin        1463238440 Nov  1 14:45 /var/opt/OV/tmp/OpC/msgagtdf
-rw-rw-r--   1 root       bin        944541567 Nov  1 14:52 /var/opt/OV/tmp/sqlnet.log
-rw-rw-rw-   1 oracle92   dba        307369984 Mar  5  2014 /var/opt/omni/tmp/rcvcat21945.exp
-rw-------   1 root       mail       187848937 Nov  1 14:01 /var/tmp/dead.letter
-rw-rw----   1 root       bin        84680704 Feb 16  2013 /var/opt/OV/tmp/OpC/msgagtdf-11975.gc
-rw-r--r--   1 root       bin        80937879 Nov  1 14:54 /var/opt/OV/log/osspi/osspi.log
-rwxrwxrwx   1 root       users      58566204 Nov  1 14:55 /var/adm/rrdtool/apcrss32.rrd
-rw-rw-r--   1 root       bin        55159884 May 25  2009 /var/opt/OV/installation/temp/bbc/fx/upload/DeplM22799
-rw-rw-r--   1 root       bin        55159884 May 18  2009 /var/opt/OV/installation/temp/bbc/fx/upload/DeplM22011
-rw-rw-r--   1 root       bin        55159884 Jun 30  2010 /var/opt/OV/installation/temp/bbc/fx/upload/DeplM10143

Next article ⇢
How to remove password expiry in HPUX HP Unix

Related stuff:

  • Create nice text banner in HPUX
  • How to start, stop and reload postfix
  • cut command and its examples
  • Format date and time for Linux shell script or variable
  • Ulimit value : All you need to know
  • Understanding /etc/fstab file
  • How to restart inetd service in Linux
  • Creating Identity provider for AWS EKS
  • How to install sar in SUSE Linux
  • Move disks/LUN from one server to another without losing data
  • How to remount filesystem in the read-write mode under Linux
  • Get list of desired LUN id from powermt output

Filed Under: Howto, Linux Tagged With: Highest size file in mount point, How to check huge files, List large files in mount point, mount point full, Mount point house keeping, Mount point is getting full

If you like my tutorials and if they helped you in any way, then

  • Consider buying me a cup of coffee via paypal!
  • Subscribe to our newsletter here!
  • Like KernelTalks Facebook page.
  • Follow us on Twitter.
  • Add our RSS feed to your feed reader.

Share Your Comments & Feedback: Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Get fresh content from KernelTalks

  • Email
  • Facebook
  • RSS
  • Twitter

Get Linux & Unix stuff right into your mailbox. Subscribe now!

* indicates required

This work is licensed under a CC-BY-NC license · Privacy Policy
© Copyright 2016-2021 KernelTalks · All Rights Reserved.
The content is copyrighted to Shrikant Lavhate & can not be reproduced either online or offline without prior permission.