我正在使用 Mac,我正在尝试为命令执行计时。
如果我做
time echo
Run Code Online (Sandbox Code Playgroud)
它没有任何输出
但如果我这样做
time ls
Run Code Online (Sandbox Code Playgroud)
它确实给了我时间函数的输出
知道为什么会这样吗?
更新:原来是因为我正在使用 zsh,并且oh-my-zsh
已安装。它在 bash 中运行良好,但在 zsh 中没有输出。知道为什么吗?
可能的两个位置:/etc/group和/etc/passwd。
如果我使用 command: adduser [username] [groupname]
,那么用户将被添加到组中,然后文件/etc/group
将被更新。
但是,该文件/etc/passwd
未更新。如果我通过命令检查我属于哪个组groups
,我只能看到passwd
文件中指定的组。因此,不会根据此结果将用户添加到组中。
镜像问题:/sf/ask/2207125371/。(得到答案后我会删除其中之一)
我很困惑。
/etc/passwd
将故事组信息分别写入、 和有何含义/etc/group
?adduser
只更新group
文件?passwd
通过命令将组添加到文件中?groups
从文件返回组信息passwd
,而不是group
文件?谢谢。