# du is ok but is not accurate
# This is because it returns the disk usage for the target
# rather than the actual file size of the target.
# However, you can get more accurate results using the `--apparent-size` arg
du --apparent-size -h path/to/<file|folder>
# -h is tell it to print in a human readable format
du -hs file/or/folder/path
---------------------------------------------------
-h for human readable
-s for summary: only total amount, not single files
#!/bin/bash
echo "Enter the full path to the file."
read file
filesize=$(ls -lh $file | awk '{print $5}')
echo "$file has a size of $filesize"