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
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.
Try:
echo $0
This often works across a range of shells.
ps PID TTY TIME CMD 223 ttys000 0:00.33 -bash
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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With