Some of you probably already know about this, but I just discovered it and wanted to share.
Tired of typing in the same terminal commands all the time? Try this:
alias cy='ssh -Y email@example.com'
Now when you type “cy” in the terminal, it automatically replaces it with the command you specify in quotes.
You can do this for each session, but even more helpful is to put these alias commands in your .bashrc file so that they are run whenever you start bash (the “rc” in “bashrc” stands for “run commands” … at least I think it does). If you’re using cygwin, this file will be located at C:\cygwin\home\(your username)\.bashrc. Open it in a text editor and put your alias commands somewhere in the middle. (On the cluster, your .bashrc file is located in your home directory, ~.)
Some useful possibilities:
- On your computer, create aliases to log into different clusters (“cy” for cyberstar, “lx” for Lion-XO, etc.)
- On the cluster, create aliases for common queue operations (“qme” for “qstat -u jdh33”, for example, which is a good idea I got from Ryan. Or “killall” for “qdel $(qselect -u jdh33)”. Pretty handy!)
- Any long commands you find yourself repeating can be aliased! Just be careful not to overwrite any existing Linux commands when you do it.
That’s all, thanks for reading.