Question: I’m trying to find out the total size of my hard drive using df -h, but it prints the size of each partition and requires sudo.
Is there any way to get total size of my hard drive using the command line, without requiring root permission?
Answer: A hacky way is to bypass the need for sudo by reading out the system log with:
dmesg | grep blocks
Please note that this might not be ideal, so your mileage may vary…