Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 01-19-2003, 10:28 AM   #1
LQ Newbie
Registered: Jan 2003
Location: Boca Raton, FL
Distribution: Slackware
Posts: 22

Rep: Reputation: 15
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
Old 01-19-2003, 11:04 AM   #2
LQ Guru
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 235Reputation: 235Reputation: 235
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
Old 01-21-2003, 04:28 PM   #3
LQ Newbie
Registered: Jan 2003
Location: Prior Lake, MN
Distribution: Slackware 8.1
Posts: 2

Rep: Reputation: 0
Try putting your aliases in '.bash_profile' (I know - different distros - different rules.)
Old 01-22-2003, 06:37 PM   #4
Registered: Jun 2002
Location: South Africa
Distribution: Customised Slackware64-14.1 with multilib
Posts: 265

Rep: Reputation: 62
Putting aliases in .profile works for me.
Old 01-23-2003, 03:55 AM   #5
Registered: Oct 2002
Location: Germany
Distribution: Debian, Non-Linux: Solaris, FreeBSD
Posts: 107

Rep: Reputation: 15
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.
Old 01-23-2003, 04:27 AM   #6
Registered: Jan 2003
Posts: 9

Rep: Reputation: 0
You can create a file in /etc/profile.*/ called 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 !
Old 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: Reputation: 45
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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
setting alias in bash, permanently allelopath Linux - General 6 10-24-2008 04:10 AM
bash login sourcing .alias ned737 SUSE / openSUSE 2 11-17-2005 02:03 AM
bash ls --color alias? tripmix Linux - Newbie 7 01-18-2005 04:49 AM
alias in bash shell wincrk Linux - General 12 07-20-2004 12:35 PM
A bash alias question CodeWarrior Slackware 11 06-03-2003 07:09 PM > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:47 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration