Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道这个命令是做什么的?
此外,《谁| grep > /dev/null' 在这个循环中为什么必须返回真或假:
until who | grep “Milad” > /dev/null do sleep 60 done
这将等到名为“Milad”的用户登录。
who获取登录用户列表,grep "Milad"过滤返回的列表以who查找包含Milad. 如果找到条目,这将返回“true”。为了抑制任何输出,它被重定向到数字厕所 ( > /dev/null)。然后整个过程在没有用户的情况下循环Milad,每次测试之间睡眠 60 秒。
who
grep "Milad"
Milad
> /dev/null