Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux “$$”在ps命令中表示什么?_Linux - Fatal编程技术网

Linux “$$”在ps命令中表示什么?

Linux “$$”在ps命令中表示什么?,linux,Linux,可能重复: 问题>$的含义是什么?它与ps命令无关,$被shell替换为其进程ID它与ps命令无关,$被shell替换为其进程ID为的shell。它是一个内置shell变量,保存PID进程ID。它是一个内置shell变量,保存PID进程ID $ ./cruncher & ./cruncher & ./cruncher & $ ps -C cruncher -p $$ -o pid,state,cmd PID S CMD 2588 S bash 2657 R /bin/s

可能重复:


问题>
$
的含义是什么?

它与
ps
命令无关,
$
被shell替换为其进程ID它与
ps
命令无关,
$
被shell替换为其进程ID为的shell。它是一个内置shell变量,保存
PID
进程ID。

它是一个内置shell变量,保存
PID
进程ID

$ ./cruncher & ./cruncher & ./cruncher &
$ ps -C cruncher -p $$ -o pid,state,cmd
PID S CMD
2588 S bash
2657 R /bin/sh ./cruncher
2658 R /bin/sh ./cruncher
2659 R /bin/sh ./cruncher

-C cmdlist      Select by command name.
                       This selects the processes whose executable name is
                       given in cmdlist.

-p pidlist      Select by PID.
                       This selects the processes whose process ID numbers
                       appear in pidlist.