aliases in .profile don't work?

Marius Gedminas marius at pov.lt
Thu Dec 9 01:46:27 UTC 2010


On Wed, Dec 08, 2010 at 04:01:38PM -0800, MR ZenWiz wrote:
> On Wed, Dec 8, 2010 at 3:19 PM, Marius Gedminas <marius at pov.lt> wrote:
> > On Wed, Dec 08, 2010 at 02:46:25PM -0800, Knute Johnson wrote:
> >> Anybody know why putting an alias in ~/.profile doesn't work but putting
> >> it in ~/.bash_aliases does?
> >
> > ~/.profile is sourced for login sessions only (both ssh logins and gdm
> > logins, the latter thanks to Ubuntu's /etc/gdm/Xsession).  Aliases
> > aren't exported via the environment, so any new shell sessions -- such
> > as those you get by opening a terminal window -- do not inherit them.
> >
> > ~/.bash_aliases is sourced for every new shell session.
> >
> This is not standard behavior - there is no special handling of
> ~/.bash_aliases built into bash.

That's right; I should've mentioned that Ubuntu's default ~/.bashrc
sources ~/.bash_aliases.

And Ubuntu's default ~/.profile sources ~/.bashrc, if detects that your
shell is bash.

You can see the default versions of these files in /etc/skel, even if
you've overridden them in your directory with customized ones.

Marius Gedminas
-- 
Favorite MS-DOS error message: "Drive C: not ready, close door."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20101209/43eec76c/attachment.sig>


More information about the ubuntu-users mailing list