1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

コマンドライン上での $$ はなに?

Posted at
  • コマンドライン上での $$ について

別の人のコマンド操作を見てた際、 /proc/$$ と打ってらっしゃいました。
$$ ってなに?

  • とりあえずechoで出してみる

なんかプロセス番号っぽい

[root@localhost ~]# echo $$
32499
  • プロセス一覧から探ってみる

rootの「-bash」 と出ました。
今、rootで操作してるので自分のプロセスってことになりそう。

[root@localhost ~]# ps aux | grep $$
root     32499  0.0  0.0 115676  2216 pts/0    Ss   14:21   0:00 -bash
root     32537  0.0  0.0 112824   968 pts/0    S+   14:27   0:00 grep --color=auto 32499
  • /proc配下を見てみる

/proc配下にディレクトリありましたね。

[root@localhost ~]# ll /proc | grep $$
dr-xr-xr-x  9 root    root                  0 12月 26 14:21 32499
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?