LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   bash and alias (https://www.linuxquestions.org/questions/slackware-14/bash-and-alias-42020/)

kleptos 01-19-2003 10:28 AM

bash and alias
 
How do i create alias's in Slackware 8.0? I am able to do so in Red Hat via the .bashrc file, but slackware seems to not use that file. Any ideas or places to look for help? I have checked some docs and found nothing. Thanks

trickykid 01-19-2003 11:04 AM

It uses those files, but doesn't create them by default. You can either create the file and edit it accordingly or put it in the system wide initilization file /etc/profile

RocketMonkey 01-21-2003 04:28 PM

Try putting your aliases in '.bash_profile' (I know - different distros - different rules.)

fskmh 01-22-2003 06:37 PM

Putting aliases in .profile works for me.

Donald1000 01-23-2003 03:55 AM

This is not a question of the distribution. The different Shells like sh, bash, ksh, csh .... read different Files on their startups. For the bash it reads, /etc/profile then $HOME/.bash_profile, if it exists. If not, it trys $HOME/.bash_login - If it doesn't exist, too it trys $HOME/.profile
Hope it helps.

mesta 01-23-2003 04:27 AM

You can create a file in /etc/profile.*/ called aliase.sh and behind write:

alias la="ls -la"
alias rm="rm -f"
....

It automatically load all files which are in /etc/profile.*/

profile.* = profile.c or profile.d or profile.r .. i don't remind me !

Darin 01-23-2003 08:01 AM

So to sum everything up...

/etc/bashrc is loaded by everyone who logs in with the bash shell which is usually the default shell.

/etc/profile is loaded by everyone logging in with any shell, at least all shells are supposed to use it.

~.profile is loaded by any shell (see above), some shells also load a
.profile if it is in your current directory like when you use su while outside your home directory.

~.bashrc ~.bash_profile and/or ~.bash_login are loaded by bash

If any of these files do not exist in your distribution they can be created and will then be used, check the man page for your shell if you aren't 100% sure.

Shells have goofy names like bash and ash which are supposed to be better than the sh shell and if you get hungry there is a korn shell and a taco shell.


All times are GMT -5. The time now is 02:07 PM.