1. 程式人生 > >liunx常用命令4

liunx常用命令4

1、which 常看常用命令位置

2、su 切換到管理員賬號  

3、passwd 設定使用者密碼   想設定簡單的密碼  去root下修改  

4、exit  退出某一個使用者

5、who  檢視當前登入的使用者

mahelin  tty1         2019-01-13 20:31 (:0)  tty代表使用者登入了作業系統

mahelin  pts/0        2019-01-13 21:50 (:0.0) pts 代表一個終端

pkill kill -t tty1

6、reboot重啟  不需要root許可權

shutdown關機   需要root許可權

shutdown -h +10 10分鐘後關機

7、chmod 設定許可權

u檔案的擁有者

g檔案的擁有的組

o其他使用者

a所有使用者

+新增許可權

-刪除許可權

=設定許可權(把之前的許可權換成新的許可權)

chmod  u+r test.txt

r

w

x

-沒有任何許可權

數字法:

r4

w2

x1

-0

chmod 123 test.txt  第一位數字代表自己的許可權,第二位數字代表自己組的許可權,第三組數字代表其他人的許可權

 

8、vim