MacOSX command line tricks
July 16, 2012 · Posted in MacOSX
Here's a list of MacOSX commands I had to search for all over the internet because I needed to use them lately and I'm sure I'm going to forget since I'm not a big OSX user. So here they are for when I'll need them again ... ![]()
In linux when you want to know which ports are opened and what applications listen on those ports you use netstat -lnp
In MacOSX you get the listening ports with this:
lsof -i |grep LISTEN
Want to see what system call am application is making use strace, for MacOSX thats:
dtruss
Here's how to install an application that comes packaged in a .dmg:
hdiutil attach App.dmg installer -package /Volumes/App/App.pkg -target /Volumes/MainDisk
uninstall a package
lsbom -fls /private/var/db/receipts/package.name.bom|tr '\n' '\0' |xargs -0 rm rm /private/var/db/receipts/package.name.*
pidof required by some mysql scripts
#!/bin/sh ps axc|awk "{if (\$5==\"$1\") print \$1}";
remount with noatime
mount -u -o noatime /dev/disk0s2 /Volumes/HD2
More to come ...
PatchLog