FreeBSD: Which Shell Am I Using? (How To Find Out)Written by: Donovan / :date_medium
Need to know which you’re using in FreeBSD?
It’s very easy to find out.
FreeBSD: Which shell am I using?
If you want to find out which shell you are currently using, you have a few options.
Just type in
You’ll get a text editor (likely
vim) pop up with some lines of info about your user and default shell that looks like this:
#Changing user information for donovan. Shell: /usr/local/bin/zsh Full Name: Donovan Nagel Office Location: Office Phone: Home Phone: Other information:
You can see there that my default shell is
Note: This method will show you your default shell, but if you’ve opened a different one, it won’t tell you.
2. echo $SHELL / echo $0
In most cases, provided you have a $SHELL variable set (usually is by default), this will display your current shell.
echo $SHELL or
echo $0 and you will get output like this:
3. ps -p $$
ps is used to show processes that are running.
This includes whatever shell is currently being used.
When you add
-p $$, this tells
ps to display the process of the current PID (your shell).
It should output something like this:
PID TT STAT TIME COMMAND 12978 4 Ss 0:00.08 /usr/local/bin/zsh
As you can see, my current shell is
Run this command:
cat /etc/passwd | grep user (replace user with your username)
It will return something like this:
As you can see, it shows this user’s default shell.View Archive