Posts 重写linux命令02_who
Post
Cancel

重写linux命令02_who

1. who命令如何运行

1.1 utmp文件

已登录的用户信息存在在文件utmp中

1.2 如何从文件中读取数据结构

  1. open
  2. read
  3. close

总结

who命令没啥好写的, 读取存放登录用户的utmp文件,然后再输入。

This post is licensed under CC BY 4.0 by the author.

Contents

Trending Tags