Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
01-19-2003, 10:28 AM
|
#1
|
LQ Newbie
Registered: Jan 2003
Location: Boca Raton, FL
Distribution: Slackware
Posts: 22
Rep:
|
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
|
|
|
01-19-2003, 11:04 AM
|
#2
|
LQ Guru
Registered: Jan 2001
Posts: 24,149
|
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
|
|
|
01-21-2003, 04:28 PM
|
#3
|
LQ Newbie
Registered: Jan 2003
Location: Prior Lake, MN
Distribution: Slackware 8.1
Posts: 2
Rep:
|
Try putting your aliases in '.bash_profile' (I know - different distros - different rules.)
|
|
|
01-22-2003, 06:37 PM
|
#4
|
Member
Registered: Jun 2002
Location: South Africa
Distribution: Custom slackware64-current
Posts: 308
Rep:
|
Putting aliases in .profile works for me.
|
|
|
01-23-2003, 03:55 AM
|
#5
|
Member
Registered: Oct 2002
Location: Germany
Distribution: Debian, Non-Linux: Solaris, FreeBSD
Posts: 107
Rep:
|
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.
|
|
|
01-23-2003, 04:27 AM
|
#6
|
Newbie
Registered: Jan 2003
Posts: 9
Rep:
|
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 !
|
|
|
01-23-2003, 08:01 AM
|
#7
|
Senior Member
Registered: Jan 2003
Location: Portland, OR USA
Distribution: Slackware, SLAX, Gentoo, RH/Fedora
Posts: 1,024
Rep:
|
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 09:07 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|