Get Total Size of Hard Drive in Linux Without Root Permissions

command linehard drivelinuxUbuntu

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?

Best 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...

Related Question