hostname
查看當前hostname
hostname
修改hostname
hostname {newName}
adduser
添加新用戶
adduser {newUser}
passwd
給新用戶新增密碼
passwd {newUser}
用戶相關操作
爲用戶賦予root權限
vim /etc/sudoers
找到下面的行,並將%wheel前的#去掉
## Allows people in group wheel to run all commands
# %wheel ALL=(ALL) ALL
然後修改用戶,使其屬於root組(wheel)
usermod -g root {user}
grep
顯示匹配字符串那行及上下2行
grep -C 2 {text} [fileName]
顯示匹配字符串那行及前2行
grep -B 2 {text} [fileName]
顯示匹配字符串那行及後2行
grep -A 2 {text} [fileName]
顯示grep版本號
grep -V