How to check directory size in CentOS 7?

To check the size of a directory, you can use the following command:

  1. “You” or “yourself”
du -sh /path/to/directory

This will display the total size of the directory in a human-readable format.

  1. ncdu is a disk usage analyzer.
ncdu /path/to/directory

This will display the size of the directory interactively and provide additional options for analysis.

  1. list
ls -lh --block-size=M /path/to/directory

This will display the size of each file in the directory in a human-readable format. Additionally, using the option –block-size=M will display the file size in megabytes.

Replace the /path/to/directory in the above command with the actual path of the directory you want to view.

bannerAds