Skip to main content

Linux command: Check Current Shell

Ways to find out current linux shell

What is your current shell?

Ways to find current shell.

echo SHELL variable

$ echo $SHELL
/bin/sh
red-stone-one-carat% echo $SHELL
/bin/rzsh
red-stone-one-carat%
$ echo $0
/bin/sh

Look for SHELL variable when run env command

$ env
MAIL=/var/mail/learnlinuxfree
USER=learnlinuxfree
SSH_CLIENT=58.187.170.49 6126 22
HOME=/home/learnlinuxfree
SSH_TTY=/dev/pts/2
LOGNAME=learnlinuxfree
TERM=xterm
XDG_SESSION_ID=9760
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
XDG_RUNTIME_DIR=/run/user/1002
LANG=en_US.UTF-8
SHELL=/bin/sh
PWD=/home/learnlinuxfree
SSH_CONNECTION=58.187.170.49 6126 173.82.240.78 22

List of available shells on a system

$ cat /etc/shells
# /etc/shells: valid login shells
/bin/sh
/bin/dash
/bin/bash
/bin/rbash
/usr/bin/tmux

Change default shell for user

root@3:~# which usermod
/usr/sbin/usermod
root@3:~# usermod --shell /bin/bash tuyendq
root@3:~# 

List of common shells

  • /bin/sh — Bourn shell
  • /bin/bash — Bourn Again shell

Popular posts from this blog

Java: error - could not find or load main class

Java Error: Could not find or load main class Java: Common mistake of beginners

VMware vSphere Hypervisor Free Version

Bare in mind that VMware vSphere Hypervisor Free Version comes with limitations Maximum 2 physical CPUs Maximum 8 vCPU per VM Cannot add to vCenter when using free license key. VMware vSphere Hypervisor Free Version supports unlimited cores per CPU and unlimited physical memory . Where to download VMware vSphere Hypervisor Free Version VMware: VMware vSphere Hypervisor (64 bit) VMware vSphere Hypervisor 8.0 (11 October 2022): https://customerconnect.vmware.com/en/evalcenter?p=free-esxi8 VMware vSphere Hypervisor 6.x: https://my.vmware.com/en/group/vmware/evalcenter?p=free-esxi6

Microsoft Windows Server 2012 R2 Standard Evaluation Product Key

Microsoft Windows Server 2012 R2 Standard Evaluation D2N9P-3P6X9-2R39C-7RTCD-MDVJX DBGBW-NPF86-BJVTX-K3WKJ-MTB6V