• About Dangerous DBA
  • Table of Contents
Dangerous DBA A blog for those DBA's who live on the edge

Find file sizes Linux / Unix

July 23, 2011 7:46 pm / Leave a Comment / dangerousDBA

I had issues a few weeks ago with trying to find which files were being written to in a system where the disks were being filled up. I got this from one of my colleagues Roger (follow on twitter:@_rogerc).

The following command is based upon “du” a fuller explanation can be found here or by typing the following into a terminal on a Linux or Unix system (where available).

man du

So to the useful command I was given which was:

du -sh /* 2> /dev/null

So breaking this command down “du” is the actual command and after the – we have “s” that for a summarised output and “h” to tell it output in a human readable format. Currently this command is looking at the folders and files that exists from root. The “2> /dev/null” part of the command will hide errors from the command in this case it is generally stuff that you cant access with the user that you are logged in as. The following would give you the file sizes in the home directory:

du -sh /home/* 2> /dev/null

Basically you need to supply the file path with a /* at the end and it will list all the files and folders in that directory. You can then change the command to the interesting directory and repeat the command on that directory.

Hopefully this will help you find those pesky files that are filling up your system.

Posted in: DB2, DB2 Administration, DB2 Maintenance, du, File Sizes, IBM, System Administration, Uncategorized

Leave a Reply Cancel reply

Post Navigation

← Previous Post
Next Post →

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 757 other subscribers

Recent Posts

  • Self generating Simple SQL procedures – MySQL
  • Google Cloud Management – My Idea – My White Whale?
  • Position Tracker – The Stub – Pandas:
  • Position Tracker – The Stub
  • Position Tracker – In the beginning
  • Whats been going on in the world of the Dangerous DBA:
  • QCon London Day 1
  • Testing Amazon Redshift: Distribution keys and styles
  • Back to dangerous blogging
  • DB2 10.1 LUW Certification 611 notes 1 : Physical Design

Dangerous Topics

added functionality ADMIN_EST_INLINE_LENGTH Amazon Bootcamp colum convert data types db2 DB2 DB2 Administration DB2 Development db2advis db2licm Decompose XML Exam EXPORT Google IBM IBM DB2 LUW idug information centre infosphere LOAD merry christmas and a happy new year Recursive Query Recursive SQL Redshift Reorganisation Reorganise Reorganise Indexes Reorganise Tables Runstats sqlcode sql statement Stored Procedures SYSPROC.ADMIN_CMD Time UDF User Defined Functions V9.7 V10.1 Varchar XML XML PATH XMLTABLE

DangerousDBA Links

  • DB2 for WebSphere Commerce
  • My Personal Blog

Disclaimer:

The posts here represent my personal views and not those of my employer. Any technical advice or instructions are based on my own personal knowledge and experience, and should only be followed by an expert after a careful analysis. Please test any actions before performing them in a critical or nonrecoverable environment. Any actions taken based on my experiences should be done with extreme caution. I am not responsible for any adverse results. DB2 is a trademark of IBM. I am not an employee or representative of IBM.

Advertising

© Copyright 2021 - Dangerous DBA
Infinity Theme by DesignCoral / WordPress