root
$ 常规用户的shell提示符
#root 用户的shell提示符,警示操作人员小心开车
id
id Display your user and group identifications
举例
$id
uid=500(cll2020) gid=500(speech) groups=500(speech),501(image),502(research)
‘gid’ 是首要组. 其他组在‘groups‘列出
计算机识别的所有用户标识都存储在文件/etc/passwd中,而所有组标识存储在文件/etc/group中
group提供了一种共享文件访问权限的方法。 特定组中要包含的用户由root定义,每个用户可以是一个或多个组的成员。
who & whoami
who Identify other users logged on to the system
举例
$ who
pris tty1 2020-09-15 17:22
gxt2018 pts/0 2020-09-23 07:49 (10.28.221.214)
gxt2018 pts/1 2020-09-23 07:57 (10.28.221.214)
liuhz2019 pts/2 2020-09-23 16:54 (10.28.222.174)
cll2020 pts/3 2020-09-23 16:45 (10.128.223.50)
gxt2018 pts/4 2020-09-23 09:35 (10.28.221.214)
cll2020 pts/5 2020-09-23 17:11 (10.128.223.50)
$ whoami
cll2020
date passwd echo clear
date Display the system time and date
举例
$ date
2020年 09月 23日 星期三 19:53:55 CST
$ date +%m-%d-%y
09-23-20
$ date +%m%d%y
092320
root 用户可以改权限 -s set
#date -s 2012-08-02
#date -s 10:08:00
#date -s “2012-05-18 04:53:00”
passwd Assign a password to your user account
root用户设置密码可以不符合规范
echo Display simple messages to your screen
clear Clears terminal screen
write
write . Sends messages to another user’s terminal
举例
$ write cll2020 pts/3
asdf
Message from cll2020@PRIS731 on pts/5 at 17:12 …
asdf
通过下述方法可以完成即时通信,即便是对方在vim,也会显示在编辑器上。
键入 [CTRL]+[d] 停止对话
mseg
mesg [y | n] 应对write命令,可理解为免打扰模式
举例
$ mesg
is y
$ mesg n
$ mesg
is n
printf & echo
printf 和echo
printf 方便格式化输出
参考:https://www.cnblogs.com/kingle-study/p/9336721.html
$PATH 是由/etc/profile默认赋值的
man
法1 $ man passwd
法2