[C:\~]$ ssh 192.168.35.128 远程连接
[root@haha2 ~]# su - xiongzheng 进入普通用户
[xiongzheng@haha2 ~]$ passwd xiongzheng
passwd:只有 root 用户才能指定用户名。
[xiongzheng@haha2 ~]$ exit
注销
[xiongzheng@haha2 ~]$ exit
注销
[root@haha2 ~]# passwd xiongzheng
更改用户 xiongzheng 的密码 。
新的密码:
无效的密码: 密码少于 8 个字符
重新输入新的密码:
[root@haha ~]# hostname haha 临时修改主机名
[root@haha ~]# hostnametcl hostname haha 永久修改主机名
[root@haha2 ~]# hostnametcl 查询主机名是否修改成功
cat查看文件内容
[root@haha2 ~]# cat /etc/shells 查看当前合法的shells
/bin/sh
/bin/bash
/usr/bin/sh
/usr/bin/bash
[root@haha2 ~]# echo $SHELL
/bin/bash 查看系统当前使用的shell
[root@haha2 ~]# /bin/sh
sh-5.1# 切换shell
sh-5.1# exit
exit 退出当前shell
[root@haha2 ~]# pwd
/root 查看当前目录
[root@haha2 ~]# cd /home/ 切换home目录
[root@haha2 home]# cd /
[root@haha2 /]# ls /
afs boot etc lib media opt root sbin sys usr
bin dev home lib64 mnt proc run srv tmp var 查看根目录
[root@haha2 /]# cd /root
[root@haha2 ~]# pwd
/root 绝对路径切换到root家目录
[root@haha2 ~]# cd /
[root@haha2 /]# cd root
[root@haha2 ~]# pwd
/root 相对路径切换到root家目录
[root@haha2 ~]# cd .. 切换到当前工作的上一级目录
[root@haha2 /]# cd . 切换到当前目录