Linux command shortcuts
November 28, 2007After a lot of searching online I finally found a way to type a long command (or a series of them) on linux without actually typing it; you just type what you want to do like compile <program name> . What you do is this:
alias <theCommandNameYouWant>=”<TheCommand>”
If you want to add more commands to run at once use a ; sign in between the commands after the equal sign. More information is given in: How to use the alias command.
CAUTION: don’t overuse the alias command because you might forget the real commands and try not to use relative addressing unless you have copies of different folders and the stuff in the folders is similar (in that case it is more convenient to go into the folder you want to compile for example and then run the aliased command there).
UPDATE: I tried doing what I said in the article and it worked as long as I don’t shutdown my computer. For some reason it doesn’t remember the alias. What you have to do is get to the .bashrc file in your user folder and type it there. In Red Hat Linux the file is in the user folder but it’s hidden so you have to “unhide it” before being able to see it. If anyone has any information about why linux doesn’t remember the alias or where to find the .bashrc file in other linux versions please write it down in the comments.


