2
2

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 5 years have passed since last update.

jobs コマンド

Posted at

jobs

この記事は Linux コマンド 全部オレ Advent Calendar 2017 の11日目の記事です。

プロセスとジョブの違い

プロセス ・・・ OS が管理するプログラムの実行単位
ジョブ ・・・ シェル(bash など)が管理するプログラムの実行単位

ジョブは同じユーザがログインしていても、制御端末が別であれば見れない。

使い方

## 端末 A
[sinsengumi ~]$ sleep 60 &
[1] 135874
[sinsengumi ~]$ sleep 60 &
[2] 135875
[sinsengumi ~]$ jobs -l
[1]- 135874 Running                 sleep 60 &
[2]+ 135875 Running                 sleep 60 &

## 端末 B
[sinsengumi ~]$ jobs -l ## 別端末のは見れない
[sinsengumi ~]$ ps auxf | grep sleep | grep -v grep
sinsengumi 135874  0.0  0.0 107904   612 pts/0    S    17:27   0:00  |           \_ sleep 60
sinsengumi 135875  0.0  0.0 107904   612 pts/0    S    17:27   0:00  |           \_ sleep 60

参考

2
2
2

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
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?