LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 06-14-2002, 08:45 AM   #1
Haldir
LQ Newbie
 
Registered: Jan 2002
Distribution: Mandrake 8.2
Posts: 26

Rep: Reputation: 15
alias and bashrc


In Sun Solaris Unix, if I want to create an alias I just create a dot alias file and add my alias. The system already knows to look in the dot alias file. In Linux, apparently I have to add a line to my dot bashrc file to point at the alias file e.g. . ./.alias. However, this doesn't seem to work. Alternatively, I can add the alias directly to my dot bashrc file, I think, but I prefer using a dot alias file if I can.
Apparently Mandrake (8.2) already sets up 14 aliases to start with as I can see them when I type alias on the command line.
Clarification of how alias works in Linux would be appreciated.
 
Old 06-14-2002, 08:48 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,415

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
mandrake puts global aliases in /etc/profile.d/alias
 
Old 06-14-2002, 01:25 PM   #3
Haldir
LQ Newbie
 
Registered: Jan 2002
Distribution: Mandrake 8.2
Posts: 26

Original Poster
Rep: Reputation: 15
I looked at /etc/profile.d and found alias.sh. I added the alias I wanted and it works. Thanks for the help.

The book: 'Linux Desk Reference' says that 'Collections of alias commands are typically stored in a file called .alias in the users home directory. That was what I expected. I wonder why Mandrake did it this way?
 
Old 06-14-2002, 06:11 PM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,415

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
persoanlly i've not seen .alias before. i guess it's probably a bit outdated. it may well still work though, you could have a look through files such as /etc/bashrc to see if your local one gets sourced or not.
 
  


Reply


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
using 'watch' on an alias in .bashrc slackist Linux - General 9 01-03-2005 01:52 AM
adding perm. alias to .bashrc Lleb_KCir Linux - General 7 12-09-2004 03:35 PM
making alias, can't find .bashrc file djgerbavore Slackware 10 07-23-2004 09:23 AM
My first alias in .bashrc...'apostrophes 'getting' in the way?' Baix Linux - Newbie 3 06-17-2004 03:36 PM
alias and .bashrc whaase Linux - General 3 11-02-2003 08:03 PM


All times are GMT -5. The time now is 10:18 PM.

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