Skip to content

Instantly share code, notes, and snippets.

@jnyryan
Created January 13, 2016 09:26
Show Gist options
  • Select an option

  • Save jnyryan/a900c580e9144b735cf3 to your computer and use it in GitHub Desktop.

Select an option

Save jnyryan/a900c580e9144b735cf3 to your computer and use it in GitHub Desktop.
Some command line tips and tricks for OSX
#!/bin/bash
#If spotlight is using up tons of CPU and slowing your comp down (MDS process), turn on/off spotlight.
alias spotlight_off="sudo mdutil -a -i off"
alias spotlight_on="sudo mdutil -a -i on"
#Turn on/off local time machine backups (local backups being extra storage when your backup drive is not connected.
alias tm_local_off="sudo tmutil disablelocal"
alias tm_local_on="sudo tmutil enablelocal”
#Prevent spotlight from indexing your backup drive to speed up backups and reduce CPU usage when backup drive is connected:
sudo touch /Volumes/<drive_name>/.metadata_never_index
# Some formatting shortcuts
alias prettyjson='python -m json.tool'
alias prettyxml='xmllint --format -'
# Finder, show hidden files
alias hidefiles='defaults write com.apple.finder AppleShowAllFiles TRUE'
alias hidefiles='defaults write com.apple.finder AppleShowAllFiles FALSE'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment