Many people want to know which shell is used in the Linux system of this machine, the following small series teaches you how to view the shell method used in the Linux system, together to understand Let's go.
can be used to view the current release of the shell
code is as follows:
[root @ localhost ~] $ cat /etc /shells
/bin/sh
/bin/bash
/sbin/nologin
View the currently used shell methods
First, the most commonly used view shell Command, but can't reflect the current shell
code in real time:
[root@localhost ~]$ echo $SHELL
/bin/bash
The following usage is not supported by all shells.
The code is as follows:
[root@localhost ~]$ echo $0
-bash
The matching lookup of the shell in the environment variable
The code is as follows:
[root@localhost ~]$ env |
Grep SHELL
SHELL=/bin/bash
Fourth, the matching search of the shell in the password file
The code is as follows:
[root@localhost ~] $ cat /etc/passwd |
Grep root
root:x:0:0:root:/root:/bin/bash
V. View current process
The code is as follows:
[root@localhost ~]$ ps
PID TTY TIME CMD
3052 pts/0 00:00:00 bash
3254 pts/0 00:00:00 Ps
Six, first look at the current shell pid, and then locate the shell process
Code is as follows:
[root@localhost ~]$ echo $$
1862
[root@localhost ~]$ ps -ef |
Grep 1862
root 1862 1860 0 01:50 pts/0 00:00:00 -bash
root 2029 1862 0 02:07 pts/0 00:00:00 ps -ef< Br>
root 2030 1862 0 02:07 pts/0 00:00:00 grep 1862
7. Enter a command that does not exist, check the shell prompt for error
:
[root@localhost ~]$ asdf
bash: asdf: command not found
Attached: A command can be implemented:
The code is as follows :
[root@localhost ~]$ ps -ef |
Grep `echo $$` |
Grep -v grep |
Grep -v ps
root 1862 1860 0 01:50 pts/0 00:00:00 -bash
The above is an introduction to the method of using which shell to use under Linux. If you don't know which shell your computer uses, try the methods described above.
Installing Vagrant on Linux system is prone to various problems, for example, some people do not kno
Under Linux, Puppet is a centralized configuration management system with its own d
under Linux Node.js is a new language in Linux, and Node.js express is some default template. Of co
Recently, some users reported that after installing Ubuntu system, java was found t
Summary of methods for restricting user su-permissions in Linux system
Ubuntu download and install j2ee development environment steps
How to install and set up MQ in Linux
Linux change 22 port method summary
Linux/Unix uses the md5sum command to compare file md5 values
The method of configuring OpenWRT routing is detailed
Techniques for installing source software under Linux system
Ubuntu installs AMD proprietary driver steps
Linux system iPtraf installation and use method
Super full and practical Win 7 system 70 tips
Solve the problem that Windows can't open add/remove programs
Windows 7 enforces advanced security encryption features
What should I do if the system startup becomes very slow after installing Win10?
Browsing webpage failure prompt "Security certificate has expired" Cause analysis and solution
Distinguish whether the win7 Ultimate system is the original system's coup
Win7 boot press F8 can not enter safe mode how to do
Windows RT 8.1 Update 3 has been pushed: Win10 start menu in
The method of extracting Win10 system icons
How Win10 Uninstalls Speakers in Case of Hardware Device Connection Error