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

hmailserver: Notes from the field

hmailserver is one of free open source mail servers running on Microsoft Windows operating system.

stegseek: Notes

StegCracker has been retired following the release of StegSeek, which will blast through the rockyou.txt wordlist within 1.9 second as opposed to StegCracker which takes ~5 hours.

VMware ESXi host loads ipmi_si_drv too long

Workaround: remove ipmi_si_drv esxcli software vib remove --dry-run --vibname ipmi-ipmi-si-drv esxcli software vib remove --vibname ipmi-ipmi-si-drv ~ # esxcli software vib remove --dry-run --vibname ipmi-ipmi-si-drv Removal Result    Message: Dryrun only, host not changed. The following installers will be applied: [BootBankInstaller]    Reboot Required: true    VIBs Installed:    VIBs Removed: VMware_bootbank_ipmi-ipmi-si-drv_39.1-4vmw.550.0.0.1331820    VIBs Skipped: ~ # ~ # esxcli software vib remove --vibname ipmi-ipmi-si-drv Removal Result    Message: The update completed successfully, but the system needs to be rebooted for the changes to be effective.    Reboot Required: true    VIBs Installed:    VIBs Removed: VMware_bootbank_ipmi-ipmi-si-drv_39.1-4vmw.550.0.0.1331820    VIBs Skipped: ~ #