Linux nohup和
时间: 2023-12-03 20:16:49 浏览: 111
& 的区别是什么?
Linux中,nohup和&这两个命令都可以让进程在后台运行,但是它们有着不同的作用。&命令可以让进程在后台运行,但是当用户退出终端时,该进程也会随之结束。而nohup命令则可以让进程在后台运行,并且即使用户退出终端,该进程仍然可以继续运行。所以,当需要在后台运行一个进程,而且想让它一直运行下去,即使用户退出终端时,可以使用nohup命令。
相关问题
linux nohup
Nohup is a command in Linux that stands for "no hangup." It allows you to run a command or script in the background even after you log out or terminate your terminal session. By using nohup, you can ensure that the process continues running even if your terminal connection is lost.
To use nohup, you can simply prefix your command with "nohup" followed by the command you want to execute. For example:
```
nohup your_command &
```
The "&" symbol at the end helps run the command in the background, allowing you to continue using the terminal. By default, nohup redirects the output to a file called "nohup.out" in the current directory. You can specify a different file using the output redirection operators.
Remember that even though nohup lets the process continue running, it doesn't provide any additional functionality for process management. You may still need to use tools like 'ps' or 'kill' to manage and monitor the background process.
linux nohup命令
nohup命令可以在Linux系统中运行一个进程,并在终端关闭后继续运行该进程。使用方法是在要运行的命令前加上“nohup”。例如:nohup command > myout.file 2>&1 &
阅读全文
相关推荐















