How To Create Aliases?

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read this

How To Create Aliases?

Postby tyndallc on Wed Apr 01, 2009 10:17 am

I am wondering how you would go about creating aliases. What I would like to be able to do is have the option of launching certain programs from a terminal session. I know that in Debian 5 you just had to edit the .bash_aliases file as well as the .bashrc file. How do you go about setting this up in Mint. I am running version 6.
tyndallc
Level 1
Level 1
 
Posts: 30
Joined: Wed Apr 01, 2009 10:12 am

Linux Mint is funded by ads and donations.
 

Re: How To Create Aliases?

Postby emorrp1 on Wed Apr 01, 2009 11:15 am

I'm pretty sure that Mint doesn't load .bash_aliases by default. You could put a "source .bash_aliases" line in .bashrc, but I've found it easier to just add the aliases right to .bashrc, as Mint also doesn't add any bloat to this file either.
If you have a question that has been answered and solved, then please edit your original post and put a [SOLVED] at the end of your subject header
Hint - use a google search including the search term site:forums.linuxmint.com
emorrp1
Level 8
Level 8
 
Posts: 2322
Joined: Thu Feb 26, 2009 8:58 pm

Re: How To Create Aliases?

Postby tyndallc on Wed Apr 01, 2009 11:26 am

How would I go about editing the .bashrc file. I am fairly new to linux and not exactly sure what I would need to put in the bashrc file.
tyndallc
Level 1
Level 1
 
Posts: 30
Joined: Wed Apr 01, 2009 10:12 am

Re: How To Create Aliases?

Postby emorrp1 on Wed Apr 01, 2009 12:02 pm

ok, no problem, you can edit/create the file using the gedit text editor. You can find it under Accessories-->Text Editor, try opening the ~/.bashrc file (don't forget to enable hidden files in the file selector using Ctrl+H) don't worry if it isn't there, as I don't think Mint has it by default so just create the new file and save with the file-name .bashrc (or run "gedit .bashrc" from the terminal to do the same thing")

To actually create aliases all you need to do is add a line to the file like:
Code: Select all
alias ls='ls --color=auto'


To add multiple aliases just add one per line. Save the file, and re-open the terminal (or a new tab) and try out the new command.
If you have a question that has been answered and solved, then please edit your original post and put a [SOLVED] at the end of your subject header
Hint - use a google search including the search term site:forums.linuxmint.com
emorrp1
Level 8
Level 8
 
Posts: 2322
Joined: Thu Feb 26, 2009 8:58 pm

Re: How To Create Aliases?

Postby tyndallc on Wed Apr 01, 2009 12:24 pm

thank you very much, works perfectly.
tyndallc
Level 1
Level 1
 
Posts: 30
Joined: Wed Apr 01, 2009 10:12 am


Return to Newbie Questions

Who is online

Users browsing this forum: No registered users and 32 guests