Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 08-15-2004, 02:48 PM   #1
Registered: May 2004
Location: Västerås, Sweden
Distribution: Slackware Current
Posts: 228

Rep: Reputation: 30
using aliases after doing su?

I have a bunch of aliases in a file called /etc/.aliases.
They're called by /etc/.bashrc which is in turn called by each accounts own .bash_profile.
My question is, how do I make them usable when I've done su logged in as an ordinary user?
A bit vague, yes, but you do get my point, right? Here's an example:

anv@Nyarlathotep /anv $ l
total 76
drwx--x--x 33 anv users 1216 2004-08-15 14:36 ./
drwxr-xr-x 5 root root 96 2004-07-20 13:08 ../

"l" is an alias for "ls -la --color"

anv@Nyarlathotep /anv $ su
root@Nyarlathotep /anv $ l
bash: l: command not found
root@Nyarlathotep /anv $

Nothing happens. How do I call the .aliases file when I'm temporarily su?
Old 08-15-2004, 03:00 PM   #2
Senior Member
Registered: Feb 2003
Location: N'rn WI -- USA
Distribution: Kubuntu 8.04, ClarkConnect 4
Posts: 1,142

Rep: Reputation: 47
Try "su -" instead of "su". The regular "su" gives you root permissions. The "su -" actually logs you in as root, and it runs the /root/.bash_profile and whatnots.
Old 08-15-2004, 03:19 PM   #3
Registered: May 2004
Location: Västerås, Sweden
Distribution: Slackware Current
Posts: 228

Original Poster
Rep: Reputation: 30
Just what I was after Thx alot m8


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
Aliases Red Squirrel Linux - Software 2 05-10-2005 07:58 PM
Aliases SkyeFyre Fedora 8 03-18-2005 08:35 PM
aliases in C++ djgerbavore Programming 6 03-16-2005 09:35 PM
See aliases gubak Linux - Newbie 0 08-04-2004 07:13 AM
what aliases do you use most? m0rl0ck Linux - General 17 02-12-2003 02:25 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:56 PM.

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