5
5

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.

コマンドラインで現在実行中の処理を終了させずにバックグラウンドに移す方法

Last updated at Posted at 2013-09-03

長時間かかる処理を動かした時や別のWindowが開くプログラムをターミナルから立ち上げたけど、後からバックグラウンドに切り替えたい時の対処方法。

  1. Ctrl+zで処理を一時停止する
  2. bg[background]コマンドで処理をバックグラウンドに移す
  3. バックグラウンドで処理中のプロセスを確認する時はjobsを使う。

ちなみにffmpeg でエンコード中に一旦止めて再開したらちゃんと続きからエンコードしてくれましたが、バックグラウンドで処理中も処理内容をずっと画面に吐き出し続けてくれるのでまともにCUIで作業することはできませんでした。

もうちょっと出力の少ないプログラムを動かしてる時に使いましょう。

ちなみにこの bgとかjobs とか fg などはbash限定のコマンドらしくマニュアルが見たい場合は man bg とかではなく man bash して "bg" などで検索してください。

もしくは help bg してください。コメントで指摘いただきました。こちらの方が一般的な方法です。

参考

ITmedia エンタープライズ : Linux Tips「現在動作中の処理(ジョブ)をバックグラウンドに回したい」
http://www.itmedia.co.jp/help/tips/linux/l0179.html

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?