Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

command to check the amount of disk space used

du

# To specify a folder
du <folder>

# -h to print the sizes in human-readable format 
# -c to specify the grand total size

# for Example, displays the grand total in human readable format
du -hc 

# We can sort the output according to size
du -h | sort -h

# to check for the larger files
du -h | sort -h | tail
OR
du -h | sort -hr | head
 
PREVIOUS NEXT
Tagged: #command #check #amount #disk #space
ADD COMMENT
Topic
Name
4+6 =