cd /:打开根目录
ls:查看目录
iconfig:查看虚拟机ip地址
mkdir:创建文件夹。
mkdir yzh
rm -rf :删除文件
rm -rf hello.txt
touch:创建文件
touch hello.txt
vi:编辑文件
vi hello.txt
按i进入insert模式,输入内容
按esc退出insert模式
输入:wq保存退出
cat:查看文件内容
cat hello.txt
useradd:创建子账号
useradd tom
passwd:修改密码
passwd tom
exit:退出当前子账号
userdel:删除子账号
userdel tom
whoami:查询当前登录用户
groups:查看当前用户所属分组
ll:查询权限
chmod:修改文件权限
chmod u+x hello.txt
chmod g+x hello.txt修改组权限 o+x修改其他组权限 +可以改成- r=读 w=写 x=执行
数字赋权
r表示4,w表示2,x表示1
具有rwx权限的数字就是7,具有rw权限的数字是6,具有wx权限的数字是3
chmod 777 hello.txt 赋予所有权限
ps -ef:查看系统进程
ps -ef|gref:筛选系统进程
ps -ef|gref ssh