Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
01-02-2008, 07:44 AM
|
#1
|
Member
Registered: Oct 2007
Posts: 53
Rep:
|
scripting/aliases
hellow everyone,
does any1 know how to use aliases without having to log out and log in again?
thanks alot in advance
and happy new year by the way
maya
|
|
|
01-02-2008, 08:24 AM
|
#2
|
Senior Member
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467
Rep: 
|
If I get your meaning you are putting aliases in .bashrc .bash_profile or some other file and having to log out and in again to use them?
What I do is put my aliases in .aliases which gets sourced from my .bashrc file:
Then if I make a new alias I just source the .aliases file from a console using the same command.
|
|
|
01-02-2008, 08:24 AM
|
#3
|
LQ Veteran
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
|
If you include some aliases in e.g .bashrc, save the file and then:
|
|
|
01-02-2008, 08:44 AM
|
#4
|
Member
Registered: Oct 2007
Posts: 53
Original Poster
Rep:
|
i am sorry,
but what does .. bashrc exactly mean?
|
|
|
01-02-2008, 08:47 AM
|
#5
|
Member
Registered: Oct 2007
Posts: 53
Original Poster
Rep:
|
acripting/aliases
so from what i understand :
i should create a .aliases file
but how to "source it" from my .bashrc file ?
thx again
maya
|
|
|
01-02-2008, 08:51 AM
|
#6
|
LQ Addict
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464
Rep: 
|
Put ". ~/.aliases" in your .bashrc file, like dive said.
". .bashrc" means to source the .bashrc file. You can also run "source .bashrc".
FWIW, I put my aliases in my .bashrc file.
|
|
|
01-02-2008, 08:53 AM
|
#7
|
Senior Member
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467
Rep: 
|
put the this in your .bashrc:
Code:
[[ -f ~/.aliases ]] && . ~/.aliases
the . (dot) command is the same as the 'source' command.
|
|
|
01-02-2008, 08:55 AM
|
#8
|
Senior Member
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467
Rep: 
|
I used to put aliases directly in my .bashrc but I have so many now that I use a separate file. Plus it is easier to source the file from the console if I add any new ones.
|
|
|
01-02-2008, 08:58 AM
|
#9
|
Member
Registered: Oct 2007
Posts: 53
Original Poster
Rep:
|
finally i understand what the dot means , thx
thanks alot for the quick reply
maya
|
|
|
All times are GMT -5. The time now is 03:10 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|