###Useful OS X commands
-
App Store Debug menu
Show
defaults write com.apple.appstore ShowDebugMenu -bool true
Hide
defaults write com.apple.appstore ShowDebugMenu -bool false
-
Remove extended attributes recursively
xattr -rc <Folder>
-
Delete Time Machine backups
sudo /System/Library/Extensions/TMSafetyNet.kext/Helpers/bypass rm -rfv /Volumes/<Disk>/Backups.backupdb/<Folder>/
-
Carbon copy a physical disk to an image (.dmg) file
source: http://hints.macworld.com/article.php?story=20050302225659382dd bs=4096 if=/dev/rXX# of=/[TARGET DIR]/image.dmg conv=noerror,sync
You have to dismount the partition first.
Use thediskutil list
andmount
commands to discover the devices. -
Convert .png images to .jpg
sips -s format jpeg ./*.png --out jpg/
-
Resample image
sips <source image> --resampleHeight <number> --out <directory>
-
Finder Error -10810
http://www.thexlab.com/faqs/error-10810.html
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -seed -rfv
-
Query locked files
lsof +c 0 | grep "\.Trash"
-
Flush and Reset All DNS Caches in OS X Yosemite 10.10.4
via http://osxdaily.com/2014/11/20/flush-dns-cache-mac-os-x/
From OS X 10.10.4 moving onward, including 10.11, Apple has ditched discoveryd and has replaced it (or rather, reverted back to) mDNSResponder. Thus, to clear DNS caches in OS X Yosemite 10.10.4, and 10.11 El Capitan, and presumably onward, the command string is as follows:sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder;say cache flushed
That command flushes all DNS caches for OS X 10.10.4+.
-
Detailed Wi-Fi Connection History
OS X Yosemite 10.10 and newer:
defaults read /Library/Preferences/SystemConfiguration/com.apple.airport.preferences |grep LastConnected -A 7