4

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

3
  • 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 Aug 9 '16 at 11:14
  • 1
    What do you mean by "cannot find it" ? du is at /usr/bin/du which should be in your default $PATH. – user4556274 Aug 9 '16 at 11:17
  • 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 Aug 9 '16 at 11:21
6

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
1
  • 6
    for me it was /Volumes/Macintosh\ HD/usr/bin/du – mb21 Jul 23 '18 at 14:19
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.

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.

1
  • Booting off a Linux live CD from an MacBook Air with no CD drive might prove difficult. – Christian Ulbrich Oct 23 '19 at 9:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.