Disk usage

 

Disk usage


  1. Synopsis: du command is used to check the information of disk usage of files and directories on a machine
du [OPTION]... [FILE]...
  1. Disk usage of a directory: To find out the disk usage summary of a /home/ directory tree and each of its sub directories
du  /home/
  1. Disk usage in human readable format: To find out the disk usage in human readable format
du  -h /home/
  1. Total disk usage of a directory: To find out the total disk usage
du  -sh /home/
  1. Total disk usage of all files and directories: To find out the total disk usage of files and directories
du  -ah /home/
  1. Total disk usage of all files and directories upto certain depth: print the total for a directory only if it is N or fewer levels below the command
du  -ah --max-depth 2 /home/
  1. Total disk usage with excluded files: To find out the total disk usage of files and directories, but excludes the files that matches given pattern.
du -ah --exclude="*.txt" /home/
  1. Help: This command gives information about du
du  --help

    Comments