帮我解析一下linux命令 [ "$(which ss 2>/dev/null)"x != ""x ] && ss -tlnp |awk 'BEGIN{num=0} /:(139|445)\s+/{num+=1;print $0}END{if(num>0){print "result=false"}else{print "result=true"}}'
时间: 2023-05-20 21:01:38 浏览: 59
这个命令的作用是检查系统中是否安装了 ss 命令。如果 ss 命令存在,则返回非空字符串,否则返回空字符串。具体来说,这个命令首先使用 which 命令查找 ss 命令的路径,如果找到了则将其输出到标准输出,否则将错误信息输出到 /dev/null。然后使用 $() 将命令的输出结果作为字符串返回,并与空字符串比较,如果不相等则说明 ss 命令存在。
相关问题
nohup java -jar app.jar > /dev/null 2>&1 & 解释一下这个命令
&1 &
This command runs a Java application in the background using the nohup command. The output of the application is redirected to /dev/null, which discards it. The 2> redirects any error messages to the same location as the output. The &1 & at the end of the command puts the process in the background and detaches it from the terminal, allowing it to continue running even if the terminal is closed.
nohup java -jar app.jar > /dev/null 2>&1 &
&1 &
This command starts a Java application in the background, redirects standard output to /dev/null (which discards it), redirects standard error to standard output, and detaches the process from the terminal by using nohup and &. This allows the application to continue running even if the terminal is closed, and prevents it from being terminated by the HANGUP (SIGHUP) signal.
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.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)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)