port installed
displays all the installed packages on the local machine, but is there any way to list the size of each one? Thanks!
port space --units MB installed
Nice and easy, has been available since version 2.0 all the way back in 2011!
I don't believe there's a build in command from Macports to list the size of your installs, but you can do this:
Try this command in the terminal:
du -sh /opt/local/var/macports/software/*
This will give you the size of every package in /opt/local/var/macports/software/*, which I believe is the default install location.
Obviously, if you install your ports somewhere else you can use
du -sh [directory]
Without a built in Macports command, this is the probably the best you can do.
One alternative that comes to mind is creating a script that would take the output of
port installed
and echo the size of each install.
edit:
I was mistaken. /opt/local/var/macports/software/* contains the tarbells that the installations were extracted from, so the sizes will be smaller.
If you do du -sh /opt/local, it should list the size of everything, but there may be a few non-macports packages in the list.
The command port contents installed
will show you the directory of everything macports has installed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With