du command not found on osx

3

I have here a macbook air and I'm wondering how can I check the size of some folders. I wanted to do so with du command but I cannot find it. Is it possible to somehow install it? Or is it possible to check the sizes of some folders with different command?

Thanks

bilak

Posted 2016-08-09T11:13:04.180

Reputation: 139

How often do you want to check the folder sizes? For once off runs (because it is slow) you can always use find. The other way is quota's, though thta is more focussed on disk space used per user rather than per folder. – Hennes – 2016-08-09T11:14:55.947

1What do you mean by "cannot find it" ? du is at /usr/bin/du which should be in your default $PATH. – user4556274 – 2016-08-09T11:17:30.503

it isn't at /usr/bin/du. However this can be due to fact that I'm in install mode of el capitan. I'm hang in process of installation, because I don't have enough space for installation. – bilak – 2016-08-09T11:21:03.167

Answers

3

Apparently, you are at the rescue mode on Mac. If you can mount your hard disk, you can use:

/Volumes/Macintosh\ HD/sbin/du

Also, if you can mount your hard disk, you can run the following command to access every command:

for path in echo /Volumes/Macintosh\ HD/{sbin,bin,usr/{sbin,bin}}; do PATH=$path:$PATH; done

Utku

Posted 2016-08-09T11:13:04.180

Reputation: 319

3for me it was /Volumes/Macintosh\ HD/usr/bin/du – mb21 – 2018-07-23T14:19:52.680

1

No ducks for you. (du -chs tells you the size of a folder, including all files and subfolders).

You're not in OSX, you're in the installation environment, which sounds like it's limited. Recommend you back out and use the current environment to free up space.

Xalorous

Posted 2016-08-09T11:13:04.180

Reputation: 459

0

it isn't at /usr/bin/du. However this can be due to fact that I'm in install mode of el capitan. I'm hang in process of installation, because I don't have enough space for installation.

Your best bet would be to boot into a Linux live CD like Finnix. From there you can run

du -hsx /* | sort -rn | head -10 

to get the 10 largest files on the drive.

user186658

Posted 2016-08-09T11:13:04.180

Reputation: 127

Booting off a Linux live CD from an MacBook Air with no CD drive might prove difficult. – Christian Ulbrich – 2019-10-23T09:03:51.283