Skip to content

Instantly share code, notes, and snippets.

@vazquez
Last active December 20, 2015 11:29
Show Gist options
  • Save vazquez/6124272 to your computer and use it in GitHub Desktop.
Save vazquez/6124272 to your computer and use it in GitHub Desktop.
Command Line Snippets
defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}'
killall Dock
defaults write com.apple.screencapture disable-shadow -bool true
Once applied, restart your computer’s UI server for the change to take effect:
killall SystemUIServer
# To show hidden files
defaults write com.apple.finder AppleShowAllFiles -bool YES
killall Finder
# To hide hidden files
defaults write com.apple.finder AppleShowAllFiles -bool NO
killall Finder
# Setting up keyboard shortcut
# To start, open up Automator (in the Applications folder) and choose a
# Service template. From the library choose "Run Shell Script" and drag it
# across to the workflow area. In the text box paste the following command:
STATUS=`defaults read com.apple.finder AppleShowAllFiles`
if [ $STATUS == YES ];
then
defaults write com.apple.finder AppleShowAllFiles NO
else
defaults write com.apple.finder AppleShowAllFiles YES
fi
killall Finder
# Finally, change the "text" drop-down menu to “no input” and then save you
# workflow as “Toggle Hidden Files”.
# Now if you go to the Finder menu and look under Services, you should find a
# “Toggle Hidden Files” option. To add the keyboard shortcut, go to the
# Keyboard section of System Preferences and click the Keyboard shortcuts tab.
# Select Services from the list on the left, then scroll down to the bottom of
# the list on the right to find “Toggle Hidden Files”. Double-click on the
# area to the right of it, then press the keyboard shortcut you want.
# I used Command-Shift-. (dot).
# To use a context menu instead of a keyboard shortcut you just need to
# follow the same instructions as above, but make some slight changes
# in Automator. Instead, change the “text’ drop-down menu to
# “Files and Folders” and the “any application” drop-down menu to “Finder”.
# Now when you right-click on a file or folder in the Finder, a new
# “Toggle Hidden Files” option should appear.
# source: http://www.macosxtips.co.uk/index_files/quickly-show-hidden-files.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment