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/

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 *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.