Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I tell which Unix shell I am using? [duplicate]

Tags:

linux

shell

unix

Is there an easy way by which I can tell which type of Unix shell I am in?

A command that shows whether I am in a Bash, C shell, KornShell (ksh), tcsh, or Z shell (zsh)?

E.g.,

whatshellisthis

like image 445
RHT Avatar asked Jul 28 '10 01:07

RHT


People also ask

How do I know if I am using bash or zsh?

Now, coming to the article's main subject, how will you know that you have bash or zsh? The answer is quite simple. Use the “–version” command to confirm the existence of both shells on your Linux system.


2 Answers

Try:

echo $0 

This often works across a range of shells.

like image 195
ggg Avatar answered Sep 20 '22 16:09

ggg


Mac

ps    PID TTY           TIME CMD   223 ttys000    0:00.33 -bash 

OpenBSD

ps    PID TT  STAT       TIME COMMAND 20038 p0  Ss      0:00.01 -ksh (ksh) 22251 p0  R+      0:00.00 ps 

Or just echo $SHELL.

like image 31
Nikolai Fetissov Avatar answered Sep 18 '22 16:09

Nikolai Fetissov