Multiple shells can be opened at the same time in Linux, but there can only be one running shell. So how do I check if the Linux system is using the Shell version? Let me introduce it below.
Shell find the version you are currently using
There are several ways to view what you currently use shell, the easiest way is through Shell by using special parameters of the shell.
First, a special parameter called “$$” indicates the PID of the shell instance you are currently running. This parameter is read-only and cannot be modified. So, the following command will also display the name of the shell you are running:
1.$ ps-p $$
2.PID TTY TIME CMD
3.21666 pts /400:00:00bash
The above command works in all available shells.
If you don't use csh, another way to find the shell you are currently using is to use the special parameter “$0” , which represents the name of the currently running shell or shell script. This is a special parameter for Bash, but it can also be used in other shells such as sh, zsh, tcsh, or dash. Use the echo command to see the name of the shell you are currently using.
1.$ echo $0
2.bash
Don't be fooled by a separate environment variable called $SHELL, which is set to be the default for your default shell. path. Therefore, this variable does not necessarily point to the shell you are currently using. For example, even if you call a different shell in the terminal, $SHELL remains the same.
1. $ echo $ SHELL
2./bin/shell
So find out the current shell, you should use $$ or $ 0, but Not $SHELL.
Finding the current shell version
Once you know which shell you are using, you may want to know the version of this shell. To do this, enter the shell on the command line and add the “--version” parameter to see the version information. For example:
For bash shell :
1.$ bash--version
2.GNU bash, version 4.3.30(1)-release (x86_64-pc- Linux-gnu)
3.Copyright(C)2013FreeSoftwareFoundation, Inc.
4.LicenseGPLv3+: GNU GPL version 3or later
5.Thisis free software; you are free To change and redistribute it.
6.Thereis NO WARRANTY, to the extent permitted by law.
For zsh shell:
1.$ zsh --version
2.zsh 5.0.7(x86_64-pc-linux-gnu)
For the tcsh shell: $ tcsh --version
1.tcsh 6.18.01(Astron)2012 -02-14(x86_64-unknown-linux) options wide,nls,dl,al,kan,rh,nd,color,filec
For some shells, you can also use shell-specific variables (eg , $BASHVERSION or $ZSHVERSION).
1.$ echo $BASH_VERSION
2.4.3.8(1)-release
The above is a way to check if the Linux system is using the version of Shell. Is it very simple? Well, everyone can try it.
less than 1024 in Linux In Linux systems, in general, ports smaller than 1024 are not open to ordin
GZIP is mainly used for file compression, and pigz is its parallel implementation version. Its compr
On Linux systems, if you want to expand disk capacity, you can create new virtual disk space. After
pscan2 is a hacker scanner that takes up a lot of CPU, so the Trojan should be clea
Summary of methods for modifying debian wheezy default configuration under Linux
The implementation principle of Linux system TSO
How to check if the Linux disk space is full?
How to use the Linux more command?
How to set up a Linux system under a RAID array
Linux system reconfig command instructions
How Linux limits user login failures through PAM
Tips for optimizing Mysql runtime environment on Linux
How to create RPM or DEB package from Linux source code
How to solve the omitting directory error when copying files in Linux?
Easily crack the Windows login password
Change the IP address gateway? Use the netsh command
Windows start → run → input command highlights gpedit.msc------------
In-depth study of various system services in Windows XP
Win10 Mobile enables full access to file systems
Why is the black screen on the right side of the Vista system screen
How to use Win7 registry to achieve switching wallpaper fade effect
Detailed introduction to the win 2003 system directory function