Skip to content

Instantly share code, notes, and snippets.

@donnywals
Last active February 2, 2016 09:35
Show Gist options
  • Save donnywals/7d5a64fc9edb1bb9e68e to your computer and use it in GitHub Desktop.
Save donnywals/7d5a64fc9edb1bb9e68e to your computer and use it in GitHub Desktop.

Basic commands

If you're not sure how to use a command or what options it has you can always do: 'man :command_name' to see the manual for that command (example: man cd)

Folders

  • Switching folders: cd :folder_name:
  • Move up one folder: cd ..
  • Going to the home folder: cd ~
  • See folder contents: ls
  • See readable folder contents: ls -la (-la are options for the ls command)
  • Open current folder in Finder: open .
  • Open any folder in Finder: open :folder_name:
  • Remove folder (Careful, it won't go to your trash. Operation can't be undone) rm -rf :folder_name:

Files

  • See file contents: cat :file_name:
  • Open file with default app: open :file_name:
  • Open file with app: open -a "App Name" :file_name:
  • Remove file: rm :file_name: (Careful, it won't go to your trash. Operation can't be undone)
  • Create empty/new file: touch :file_name:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment