| Author |
Message |
|
eemaestro
MEPIS Rules!
Joined: Wed Aug 02, 2006 12:12 pm Posts: 493 Has thanked: 52 times Have thanks: 6 times
|
Post # 299181
 Aliases in multiple shell instances
I noticed that when I am typing in a Konsole window, an alias that I defined in a different Konsole window is undefined. Has anybody figured out a way to automatically share aliases among shell instances, so I don't have to type in my alias in different shells? I can define all my aliases in a Bash-script file called aliases. But how would I have the shell instance automatically run that script when I switch to it (or when I create it )?
|
| Fri Apr 27, 2012 10:20 am |
|
 |
|
Adrian
MEPIS Enthusiast
Joined: Wed Jul 12, 2006 1:42 am Posts: 3544 Has thanked: 181 times Have thanks: 297 times
|
Post # 299183
 Re: Aliases in multiple shell instances
You have to call that aliases script from .bashrc which gets executed every time you open a shell. I have in mine these lines: Of course change .bash_aliases to whatever file name you use. You could also put the aliases directly in .bashrc, but it's nicer to keep them in a separate file.
_________________ Nobody is born with knowledge, knowledge comes from manuals and Google (and our beloved Wiki)
|
| Fri Apr 27, 2012 11:19 am |
|
 |
|
eemaestro
MEPIS Rules!
Joined: Wed Aug 02, 2006 12:12 pm Posts: 493 Has thanked: 52 times Have thanks: 6 times
|
Post # 299198
 Re: Aliases in multiple shell instances [Solved]
Thank you, Adrian. I used the filename you suggested. I moved my aliases script file from aliases to the name you suggested. It worked! Thank you. BTW, I was surprised to get this message I thought that -a would include files beginning with a dot. Didn't show anything. I had to do this:
|
| Fri Apr 27, 2012 2:54 pm |
|
 |
|
eemaestro
MEPIS Rules!
Joined: Wed Aug 02, 2006 12:12 pm Posts: 493 Has thanked: 52 times Have thanks: 6 times
|
Post # 299267
 Re: Aliases in multiple shell instances
Adrian,
I followed your example. I consolidated all my aliases into one file. Now it works automatically when I create a new Konsole window. I need no longer redefine my desired alias.
Thank you for helping me. I appreciate it.
|
| Sun Apr 29, 2012 2:25 pm |
|
 |
|
Adrian
MEPIS Enthusiast
Joined: Wed Jul 12, 2006 1:42 am Posts: 3544 Has thanked: 181 times Have thanks: 297 times
|
Post # 299291
 Re: Aliases in multiple shell instances
Glad to be of help. I went one more step and put my .bash_aliases in my Dropbox and then linked it to home so I have the same aliases no matter what computers I use. I've done the same for .bash_functions
(will move to Google drive once they release a linux client).
_________________ Nobody is born with knowledge, knowledge comes from manuals and Google (and our beloved Wiki)
|
| Mon Apr 30, 2012 11:59 am |
|
 |
|
Jerry3904
MEPIS Enthusiast
Joined: Wed Jul 19, 2006 6:13 am Posts: 6445 Location: Geneva NY Has thanked: 1384 times Have thanks: 1033 times
|
Post # 299292
 Re: Aliases in multiple shell instances
I think this is right: aliases stored in .bashrc in the /home directory will not work in a root terminal. The file would need to be copied and pasted (as root) into the /root directory.
_________________ A Wiki only works when many eyes are on it.
32bit, 2.6.36-1-mepis-pae, KDE 4.6.5, AMD Phenom 9650 Quad-Core, Dell SP2309W with integrated webcam, Nvidia GeForce 6150SE, 4 GB DDR2
|
| Mon Apr 30, 2012 12:07 pm |
|
|