Download your favorite Linux distribution at LQ ISO.
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 11-15-2004, 04:57 PM   #1
Registered: Dec 2002
Location: Brisbane, Australia
Distribution: RedHat (RHEL, FC, CentOS), openSuSE, Mac OS X
Posts: 653

Rep: Reputation: 32
Determining which shell is in use

I'm guessing i'm going for the stupidest question of the month award, but:

How do i work out which shell i'm working in? I know that the default shell is set for ever user, and kuser shows me what shell is used for any particular user, but i notice that if you working as myself and i change to root (via su) coloring and so forth disappears (as in file type highlighting).

How do i check which shell i'm in, and is this change in color an intentional mode change ??
Old 11-15-2004, 05:12 PM   #2
LQ Newbie
Registered: Nov 2004
Location: San Diego, CA
Distribution: RH 8/9
Posts: 4

Rep: Reputation: 0
Re: Determining which shell is in use

Hi chakkerz,
try the ps command.
If you look at the output below it shows you that bash is the shell running for both users (gabe and root).
also "echo $SHELL" will tell you what shell is running.
As far as the colors go, I'm not sure what the problem is. try typing export to see if the shell variable LS_COLORS is set or if the shell variable COLORS is set. you can do this by typing:
echo $COLORS

[root@koso gabe]# whoami
[root@koso gabe]# ps
860 pts/0 00:00:00 su
861 pts/0 00:00:00 bash
1193 pts/0 00:00:00 ps
[root@koso gabe]# exit
[gabe@koso gabe]$ whoami
[gabe@koso gabe]$
[gabe@koso gabe]$ ps
818 pts/0 00:00:00 bash
1195 pts/0 00:00:00 ps
[gabe@koso gabe]$

Old 11-15-2004, 05:47 PM   #3
Registered: Dec 2002
Location: Brisbane, Australia
Distribution: RedHat (RHEL, FC, CentOS), openSuSE, Mac OS X
Posts: 653

Original Poster
Rep: Reputation: 32
Ahh ... sweet ... i knew it had to be something simple ... Thanks for that.


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
Shell: Tar files: programmatically determining the name of the target directory stefanlasiewski Programming 3 08-17-2005 08:48 PM
determining shell abk4523 Linux - Newbie 2 06-09-2005 08:28 AM
Determining current shell subu_s Programming 11 01-04-2005 07:10 AM
determining if shell is local connection or remote SaxyWeed Linux - General 3 01-26-2004 11:17 PM
Determining IP bluethundr Linux - Newbie 1 08-11-2003 11:16 PM

All times are GMT -5. The time now is 11:17 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