- To update db of files indexed by locate:
sudo /usr/libexec/locate.updatedb
locate -i <file>
(-i flag for case-insensitive search)
-
locate
is faster thansudo find / -iname "word"
-
To see statistics about the information that locate has cataloged, use the
-S
option:
locate -S
sudo ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl
-
brew install <something>
-
update brew itself:
brew update
- update tools installed with brew:
brew upgrade
brew upgrade <something>
- install the GNU version of sed called gsed (Mac's sed is BSD based):
brew install gnu-sed
tree
displays a tree view of the filesystem
-
brew install tree
-
tree -d
to view just the directories and to suppress listing file names
sudo ifconfig awdl0 down
And vice versa to restore AirDrop and AWDL (and the WiFi issues):
sudo ifconfig awdl0 up
- pbcopy (pasteboard copy) - to pipe the output of the command to the OS X clipboard:
cat ~/.ssh/id_rsa.pub | pbcopy
- pbpaste (pasteboard paste)
pbpaste > file.txt
- To escape spaces properly in the directory path:
pwd | pbcopy
cd "`pbpaste`"
or
cd "$(pbpaste)"
mdfind <keyword>
To find all executables:
mdfind "kMDItemKind == 'Unix Executable File'"
sudo find /Applications -type d -name *.app -prune -exec sh -c 'ls -R "$1" | grep -q \.jar\$' {} {} \; -print