gpt4 book ai didi

linux - 最后|在linux中重新启动会重新启动机器,有人可以解释为什么吗?

转载 作者:太空宇宙 更新时间:2023-11-04 04:44:03 26 4
gpt4 key购买 nike

下面的管道是如何工作的?

last | reboot

上面重新启动了 Linux 机器。

最佳答案

last 搜索最后登录的用户,并将 last 输出提供给 reboot,并且 reboot 将重新启动系统。

last         |          reboot
| | => process1 output will be input
process1 process2 for process2

查看上面所说的man 1 last

Last searches back through the file /var/log/wtmp (or the file desig‐ nated by the -f flag) and displays a list of all users logged in (and out) since that file was created.

正如 Daniel 所说,reboot 并不关心其输入。它可能根本不读取它,因此输入某些内容不会改变它的行为。

关于linux - 最后|在linux中重新启动会重新启动机器,有人可以解释为什么吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49837940/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com