※ &にてバックグラウンドでジョブ実行 -> nohupコマンドでログアウト後もジョブを実行させる事が可能
[root@localhost ~]# updatedb &
[1] 3688
[root@localhost ~]# ps
PID TTY TIME CMD
2522 pts/1 00:00:01 bash
3688 pts/1 00:00:02 updatedb
3691 pts/1 00:00:00 ps
[root@localhost ~]# jobs
[1]+ Running updatedb &
[root@localhost ~]#
※SSHでのPortフォワーディングでも使えそう。
[root@localhost ~]# nohup updatedb &
[1] 3705
[root@localhost ~]#
[root@localhost ~]# jobs
[1]+ Running updatedb &
[root@localhost ~]# jobs
[1]+ Done updatedb
[root@localhost ~]# nohup updatedb &
[1] 3705
[root@localhost ~]#
[root@localhost ~]# jobs
[root@localhost ~]# updatedb &
[1] 3711
[root@localhost ~]# jobs
[1]+ Done updatedb
※bgコマンド,fgコマンドで切り替え
[root@localhost ~]# tail -f /var/log/messages &
[1] 3722
[root@localhost ~]#
[root@localhost ~]# jobs
[1]+ Running tail -f /var/log/messages &
[root@localhost ~]# fg 1
tail -f /var/log/messages