Skip to content

Instantly share code, notes, and snippets.

@dan-mckay
Last active December 23, 2015 12:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dan-mckay/6634914 to your computer and use it in GitHub Desktop.
Save dan-mckay/6634914 to your computer and use it in GitHub Desktop.
Useful Unix Commands for Mac

Useful Unix Commands for Mac

List all symlinks in a directory

ls -la . | grep "\->"

Make a symlink

ln -s path/to/real/file path/to/symlink

Delete a symlink - same as removing a file

rm path/to/symlink

Tar (archive) and gzip (compress) a directory

tar -czf <folder_name>.tar.gz <folder_name>/

Output all curl commands in the terminal (then highlight to copy, right-click and paste)

history | grep curl

Move a directory into a destination directory

mv <sourceDir> <destDir>

Output all HTML files in current directory and sub directories

find . -print | grep -i '.*[.]html'

Search for string recursively in target directory, ignoring case and outputting filename & line number to stdout

grep -rHni 'someString' ~/projects
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment