nohup nsqlookupd -tcp-address=0.0.0.0:{{ nsqlookupd_port }} > /dev/null 2>&1 &是什么意思?
时间: 2024-05-20 07:17:50 浏览: 15
&1 &
This command starts the NSQ lookup daemon and redirects its output to /dev/null. The {{ nsqlookupd_port }} variable is replaced with the actual port number. The "&1 &" at the end of the command puts the process in the background and allows the terminal to be used for other commands. The "nohup" command ensures that the process continues to run even if the terminal is closed.
相关问题
解释这段代码:nohup java -jar /root/pig-gateway.jar $JAVA_OPTS > /dev/null 2>&1 &
这段代码是在 Linux 系统中使用 `nohup` 命令将一个 Java 程序以后台方式运行,并且将输出重定向到 `/dev/null` 文件中。
解释每个部分的含义如下:
- `nohup`: 用于在终端关闭后仍然继续运行命令。
- `java -jar /root/pig-gateway.jar`: 运行名为 `pig-gateway.jar` 的 Java 程序。
- `$JAVA_OPTS`: 这是一个环境变量,用于传递 Java 虚拟机的参数。在这里,它被用作 `java` 命令的参数。
- `> /dev/null`: 将标准输出重定向到 `/dev/null` 文件中。`/dev/null` 是一个特殊的设备文件,它会丢弃一切写入它的数据。
- `2>&1`: 将标准错误输出重定向到标准输出。这样做可以确保所有的输出(包括错误信息)都会被重定向到 `/dev/null` 文件中。
- `&`: 将命令放入后台运行,不会阻塞终端,并且可以继续输入其他命令。
综上所述,这段代码的作用是在后台运行一个名为 `pig-gateway.jar` 的 Java 程序,并将输出重定向到 `/dev/null` 文件中,以及将错误信息也重定向到相同的文件中。这样做可以让程序在终端关闭后继续运行,并且不会产生任何输出。
nohup java -jar luotuo.jar --spring.profiles.active=superprod --server.port=10007 >/dev/null &
这是一条 Linux 命令,用于在后台运行一个 Java 程序。解释如下:
- `nohup`:表示不挂起程序,即程序在执行时即使终端关闭也不会停止。
- `java -jar luotuo.jar`:表示运行名为 luotuo.jar 的 Java 程序。
- `--spring.profiles.active=superprod`:表示使用名为 superprod 的 Spring Profile 配置。
- `--server.port=10007`:表示将服务器端口设置为 10007。
- `>/dev/null`:表示将输出重定向到空设备,即不打印输出信息。
- `&`:表示将命令放到后台运行。
因此,这条命令的作用是在后台运行一个名为 luotuo.jar 的 Java 程序,使用 superprod 的 Spring Profile 配置,服务器端口为 10007,输出信息被重定向到空设备。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)