“&"是什么意思在linux命令末尾是什么意思? [英] What does "&" at the end of a linux command mean?

查看:147
本文介绍了“&"是什么意思在linux命令末尾是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是系统管理员,被要求运行linux脚本来清理系统.

I am a system administrator and I have been asked to run a linux script to clean the system.

命令是这样的:

perl script.pl > output.log &

所以该命令以&符号结尾,它有什么特殊意义吗?

so this command is ending with a & sign, is there any special significance of it?

我对shell有基本的了解,但是我以前从未见过.

I have basic knowledge of shell but I have never seen this before.

推荐答案

&使命令在后台运行.

来自man bash:

如果命令被控制操作员& 终止,则外壳 在子外壳程序中在后台执行命令.壳做 不要等待命令完成,并且 返回状态为0.

If a command is terminated by the control operator &, the shell executes the command in the background in a subshell. The shell does not wait for the command to finish, and the return status is 0.

这篇关于“&"是什么意思在linux命令末尾是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆