Skip to content

Instantly share code, notes, and snippets.

@davebeach
Last active April 13, 2019 12:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davebeach/286b6d9560412d93649126938edddc2e to your computer and use it in GitHub Desktop.
Save davebeach/286b6d9560412d93649126938edddc2e to your computer and use it in GitHub Desktop.
Mac OS X Useful Terminal Commands

File Management

  • Show or hide hidden files AppleShowAllFiles YES. Don't forget to refresh finder. Option+Finder Icon

  • To remove the quarantine status of a new file on mac (as it causes problems with keys etc) xattr -d com.apple.quarantine filename.pem FILE

  • to remove from all computers quarenteen files (warning as may be too large to attempt if you download a lot, and or recently) find . | xargs xattr -d com.apple.quarantine

  • to clear att xattr: xattr -c filename.pem

SSH Security

  • To remove server entry from known_hosts rather than manually edit via vim or nano ssh-keygen -R hostname

Network

  • List Network Connections and Application Association and Ports lsof -i netstat -atp tcp | grep -i "listen"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment