ruk·si

Commands
Magic

Updated at 2013-03-30 20:38

This note contains some magic commands that can be useful. These work on most distributions, but sometimes you need to install the program.

# Run last command after replacing parts of the command.
^to_replace^new_text

# Run last command as root.
sudo !!

# Argument expansion.
mv app/models/foo.rb app/models/foobar.rb
# is same as
mv app/models/{foo,foobar}.rb

# To replace all
!!:gs/text_to_replace/new_text

# Share current directory over HTTP.
python -m SimpleHTTPServer 8080

# Get your OS X talking.
say yeah!