Create permenant aliases with .bashrc

Sometimes, it’s easier to create an alias when working with the Unix command line. Having to create these every time seems to defeat the point of having a short alias though. Luckily, you can make them persistent.

Lets assume that we are using a user called mike. We need to be in our home directory.

cd /home/mike

The .bashrc file should be in there, but hidden.

ls -a

You should be able to see it listed. Now lets edit it.

vim .bashrc

And add a command in, for example, to save our usual CVS update command.

alias upd='cvs -q update -P -d'

Now save and exit. After that, every time you log onto the box you can use the upd command to run the CVS update.

Timeline

Newsletter

Don't have time to check my blog? Get a weekly email with all the new posts. This is my personal blog, so obviously it is 100% spam free.

Metadata

Tags: , , , ,

This entry was posted on Saturday, July 7th, 2012 at 2:21 pm and is filed under Life, Tech. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.