LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Permanent aliases (https://www.linuxquestions.org/questions/slackware-14/permanent-aliases-211114/)

Acetylcholine 07-29-2004 01:08 PM

Permanent aliases
 
Im using bash and I want to know what config file stores the permanent aliases?

because
alias ffox=/usr/local/firefox/firefox

works till log out

Thanks.

Cedrik 07-29-2004 01:12 PM

I would put it on my ~/.bashrc as home configs files are good for customs settings without touch system files

AhYup 07-29-2004 01:30 PM

This seems to be a little different in differnent systems. The system default for all Bourne shells in Slackware is /etc/profile If you put your alias there than it will be useable in any login.
I thought that you would want .profile in your home setting for Slack as well but
Cedrik may be right.

jschiwal 07-29-2004 03:19 PM

The info bash page gives information on the different startup shells that bash reads in when starting up. The .bashrc file is read in every time a new shell is opened, while .bash_profile is read in when a login shell is starting.

Your distro probably has a .bash_profile or .profile script sourcing the .bashrc, so it is run even when first logging in.
This webpage contains a good wrapup:
http://www.comptechdoc.org/os/linux/...vironment.html
from the above webpage:
$HOME/.bash_profile - Users environment stuff and startup programs
$HOME/.bashrc - user aliases and functions
$HOME/.bash_logout - User actions to be done at logout
$HOME/.inputrc - Contains keybindings and other bits.




One thing that determines which script to write is determined on the shell you might use. .profile is read in by both bash and

Acetylcholine 07-29-2004 05:39 PM

Thanks. I picked this up in the meantime in the case of global aliases:
(http://www.bellevuelinux.org/alias.html)

The root user can create aliases just for its own use, or it can create them for any or all other users. On Red Hat Linux, aliases for the root user can be made permanent by entering them in the .bashrc file in the root's home directory, i.e., /root/.bashrc. System-wide aliases can be put in /etc/bashrc. The system needs to be restarted before system-wide aliases can take effect.



Thanks!

jschiwal 08-04-2004 02:08 AM

Mandrake has a alias.sh file that is sourced by the startup scripts. This keeps the global aliases in one place, by themselves so there is less chance of mucking up the startup scripts.

ksun 01-06-2005 03:29 PM

You might consider this slightly off topic, but a solution to the originally stated problem might be to install the firefox stuff in a place like /usr/lib and put a symlink in /usr/bin

Alternatively, it is a pretty common practice for some people to create a ~/bin directory and put that in their path. You could put a symlink there for just your use.

Like I said, it doesn't really follow what everyone else was talking about, but it might be a couple different solutions to your stated problem.


All times are GMT -5. The time now is 12:57 PM.