How to check directory size in CentOS 7?
To check the size of a directory, you can use the following command:
- “You” or “yourself”
du -sh /path/to/directory
This will display the total size of the directory in a human-readable format.
- 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.
- 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.