This Bash script reports disk usage of a given directory. It checks that the user provides a valid directory path, calculates the total size, and then lists the sizes of all files and subdirectories (depth 1) in human-readable format, sorted largest to smallest. The results are written to file_sizes.txt and also displayed on the terminal.
chmod +x check_size.sh
./check_size.sh /path/to/directory