Personal tools
You are here: Home DB2 Useful Unix and Linux Commands How to list the most biggest directory on AIX
Navigation
Log in


Forgot your password?
 
Document Actions

How to list the most biggest directory on AIX

du command - To list the most biggest directory



To list the five most biggest directory, you have to perform the command below:

du -sk ./* | sort -rn | head -5
Output:
$ du -sk ./* | sort -rn | head -5
27921556  ./dir100d
1920392 ./dir200d
14036   ./sqllib
8       ./dir300d
5       ./dir400d


Explaining the command above:


du


  • The du command displays the number of blocks used for files. If the File parameter specified is actually a directory, all files within the directory are reported on. If no File parameter is provided, the du command uses the files in the current directory.
  • ./* - This is the location where the du command will be display the number of blocks used for files inside the ./* directory
  •  Specifying the -s flag reports the total blocks for all specified files or all files in a directory.
  •  Specifying the -k flag shows the size of blocks in Kilobytes


sort


  • The sort command sorts lines in the files specified by the File  parameter and writes the result to standard output.
  •  -r     Reverses the order of the specified sort.
  •  -n   Sorts numeric fields by arithmetic value.
     

head

  • The head command writes to standard output a specified number of lines or bytes of each of the specified files, or of the standard input. If no flag is specified with the head command, the first 10 lines are displayed by default.

Security Awareness
Would you like your company to implement gamification into your security awareness program?





Polls