Handy OSX bash command collection – Part 2254

Note to myself…

The famous ‘locate’ command

noship:~ $ # build the 'locate' database (that's different from Linux)
noship:~ $ sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist

noship:~ $ locate whatever

Create a graphical view of sub folders from the command line

noship:~ $ ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'
 |---Application Support

Securely delete and purge a drive

noship:~ $ diskutil secureErase freespace 3 /Volumes/name-of-drive

Shutdown like a boss

noship:~ $ sudo shutdown -r now

Error Message Texts

noship:~ $ macerror -22
Mac OS error -22 (unitEmptyErr): I/O System Errors



Leave a Reply

Your email address will not be published. Required fields are marked *