Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
2
Help us understand the problem. What are the problem?

More than 3 years have passed since last update.

posted at

jobs コマンド

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

参考

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
2
Help us understand the problem. What are the problem?