.bashrc,.aliases

I have a question for aliases.
Under my local home profile I see .aliases and .bashrc

1 If I need to update .aliases should I also update .bashrc as well? I see entried which exist in .aliases also in .bashrc
2) Should I exit and login to my home profile each time I make any update to .aliases/.bashrc
pal2kAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

larry urbanDevOps EngineerCommented:
1) .aliases is usually called by .bascrc; you should not put updates in them both, just one or the other. If you .bashrc is not referencing your .aliases then make sure to just do your updated to the .bashrc.

2) not really, you should only have to open a command line window a few times if it is an update just for command line options. If it is an update that would affect your profile in  more global sense, then a re-login is required.
0
larry urbanDevOps EngineerCommented:
1) .aliases is usually called by .bascrc; you should not put updates in them both, just one or the other. If you .bashrc is not referencing your .aliases then make sure to just do your updated to the .bashrc.

2) not really, you should only have to open a command line window a few times if it is an update just for command line options. If it is an update that would affect your profile in  more global sense, then a re-login is required.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
pal2kAuthor Commented:
I see that .bashrc is calling .aliases
But If I don't exit and re-login I dont see changes in aliases update?
I also see that what ever in .aliases also exist in .bashrc? why is that? when I tried to just update only the .aliases after re-login it works.
0
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

larry urbanDevOps EngineerCommented:
the purpose of .aliases is for command line shortcuts like setting ls to be equal to a ll -a. it is just to separate code snippet types.

Seeing the changes depends on what they are, usually in my experience, if I add an alias in the .alieses or .bashrc I have to open 5 new window before I see the changes (using Mandrake in my case) on other distros may be different too.
I'm not sure why you would see code in both, it may be that .aliases is being used also by other scripts, so they were added there too.
0
simon3270Commented:
Having the same alias in two places, particularly if one script calls the other, is a bad idea - if you change one you have to remember to change both, to be sure that your new version is used and to avoid later confusion.  I would have them only in .aliases.

You don't need to log in again - just:
cd
. .aliases

Open in new window

to re-read your aliases.  This will overwrite any changed ones and create new ones, but any you have deleted from .aliases will still be there, until you log out and in again.  Remember that this has to be a complete logout - if you have a graphical display you need to log out of that, not just close one of the terminal windows on that graphical screen.
0
pal2kAuthor Commented:
I meant 2 places is .aliases and .bashrc. But what Todar said make sense. I guess .aliases might be used by other scripts. Anyways....thanks guys
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Shell Scripting

From novice to tech pro — start learning today.