Running a command as a background process/service

前端 未结 5 2048
猫巷女王i
猫巷女王i 2021-02-13 03:27

I have a Shell command that I\'d like to run in the background and I\'ve read that this can be done by suffixing an & to the command which causes it to run as a

5条回答
  •  没有蜡笔的小新
    2021-02-13 04:14

    UNIX systems can handle as many processes as you need simultaneously (just open new shell windows if you're in a GUI), so running a process in the background is only necessary if you need to carry on using the current shell window for other things once you've run an application or process that keeps running.

    To run a command called command in background mode, you'd use:

    command &
    

    This is a special character that returns you to the command prompt once the process is started. There are other special characters that do other things, more info is available here.

提交回复
热议问题