making aliases system wide

Jeff Vian jvian10 at charter.net
Mon Mar 21 18:06:11 UTC 2005


On Mon, 2005-03-21 at 19:45 +0900, Mark Sargent wrote:
> Michael A. Peters wrote:
> 
> >
> > On 03/21/2005 01:19:30 AM, Mark Sargent wrote:
> >
> >> Hi All,
> >>
> >> I know that alias shows all aliases, and alias dirmysql='cd /usr/ 
> >> local/mysql' allows me to just type dirmysql @ the promt to move to  
> >> the mysql dir. But, how do I get this to be system wide and remain  
> >> after a reboot. At the moment, if I open another terminal window  
> >> after making the alias, it doesn't carry over to the new one. My  
> >> book, Beginning Fedora2(I'm using 3 now) covers only how to make the  
> >> alias. Could someone tell me what I need to make it permanent, or  
> >> what I'm not understanding.? Cheers.
> >
> >
> > You can put it in your .bashrc file.
> >
> > To do it systemwide for ALL users - put an executable shell script 
> > that  sets it in /etc/profile.d/ (don't modify an existing file in 
> > there,  make a new one)
> >
> > For an example of what that would look like - run
> >
> > cat  /etc/profile.d/which-2.sh
> >
> > You want to make a file of that form and make it executable in /etc/ 
> > profile.d/
> >
> > but only if you want it system-wide (for just your user, edit .bashrc  
> > in your home (~) directory )
> >
> Hi All,
> 
> ok, dirmysql was just an example. For it, I want only root to be able to 
> use it, but for this one, for example, alias dirdlds='cd 
> /home/paranor/downloads' I'd like it available to both root and the user 
> paranor. Whilst I un I can put it in the .bashrc file for paranor, how 
> about for root..? Cheers.
> 
> Mark Sargent.
> 

If you only want it for one or two users, put it in the specific
~/.bashrc for that user (root, paranor, etc).  If you want it for
everyone on the system put it in /etc/bashrc (assuming that everyone
will be using bash as their shell of course). 




More information about the users mailing list