Skip to content

Instantly share code, notes, and snippets.

@juliankrispel
Last active December 14, 2015 02:58
Show Gist options
  • Save juliankrispel/5017035 to your computer and use it in GitHub Desktop.
Save juliankrispel/5017035 to your computer and use it in GitHub Desktop.
Bash Cheatsheet

Dealing with $path

To edit $path on Mac OS lion create a file with a simple list of directories, line per line like this:

path/to/something path/to/something/else

and add the file to /etc/paths.d/

You could also directly edit the paths file under /etc/paths

.*rc Files

Further reading on shell-file-loading: http://hayne.net/MacDev/Notes/unixFAQ.html#shellStartup

If .bash_profile or .bash_login exist .profile will not be loaded.

Python Server

python -m SimpleHTTPServer [port]

PHP Server

php -S localhost:8000

Make file executable

chmod +x somefilename.sh

Find files

find . -name 'somefile.js'

Create bare compass project

compass create --bare folder_name

Using regex with files (Taken from here)

Put the following to your .bashrc

shopt -s extglob It extends regexes.

You can then move all files except one by

mv !(fileOne) ~/path/newFolder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment