The shell in the system is a programming language that can execute various commands. How to view the shell? The following small series will introduce you to how to view the current shell under Linux, let's get to know it.
1, real-time view shell species currently used in the process: Recommended
code is as follows:
ps |
Grep $$ |
Awk ‘{print $4}’
(Note: $$ indicates the shell process number)
2, the most commonly used command to view the shell, but can not reflect the current shell in real time
The code is as follows:
$ echo $SHELL
3, more concise, but not all shells support
The code is as follows:
$ echo $0
4, the matching search of the shell in the environment variable
The code is as follows:
env |
Grep SHELL
5, the matching search of the shell in the password file
The code is as follows:
cat /etc/passwd |
Grep muye
6. When using ps -ef
The code is as follows:
$ ps -ef |
Grep $$ |
Grep -v grep |
Grep -v ps
Note: grep -v means negation, as follows:
The code is as follows:
"a href=“mailto:muye@bupt:~$ ”"muye@bupt:~$"/a" ps -ef |
Grep $$
muye 4750 4745 0 15:47 pts/1 00:00:00 bash
muye 5331 4750 0 16:51 pts/1 00:00:00 ps -ef< Br>
muye 5332 4750 0 16:51 pts/1 00:00:00 grep --color=auto 4750
Remove the two
The above is the view of the shell under Linux The method is introduced. If you don't know how to view the shell, you can try the method described in this article. Generally, you can use the command to view it. Do you understand?
Regular expressions are not unique to Linux systems, but regular expressions are a
As a Linux system monitoring tool, Collectl is a recommended software. Collectl can
In many Linux commands, the cut command can be used to intercept file information and intercept Linu
The MAC address is the physical address of the network card, which users can modify. Today Xiaobian
CentOS 6.2 configuration vim development environment steps
How to solve the garbled problem when opening Emacs under Linux?
Linux MyEclipse start Tomcat too slow how to do?
How to install and use Sphinx in Linux system
Git Workflow and Basic Operations in Linux
What is optimized for Linux kernel 4.2?
How to use the test command in Linux
How to improve the speed of Google Chrome running under Linux?
Ubuntu 12.04 install Gnome Shell extension method
How to implement Windows Server 2003 network load balancing
Large hard disk recommended for Windows 7 system partitioning scheme
What are the new features of Win10 Preview 9888?
Microsoft pushed Win10 Mobile Preview 10536 Express Edition Configuration Update
How to set up a microphone in win7? Win7 set the microphone method
Windows 8.1 installed these 15 places to set the
How to open a folder using a separate process on a win7 computer?
View QQ friends IP address in Win7 resource monitor
Application Tips: Changing the Boot Loader Method under Multiple Systems