1、sudo权限
在真正生产上我们不会拿到root账号,但是我们在某些特定的地方会使用到root权限,那么该如何赋予普通用户的sudo权限呢,这时就要使用vi /etc/sudoers命令
- su - jepson
vi /etc/sudoers
jepson ALL=(root) NOPASSWD:ALL
##Next comes the main part: which users can run what software on
##which machines (the sudoers file can be shared between multiple
##systems).
##Syntax:
##user MACHINE=COMMANDS
##The COMMANDS section may have other options added to it.
##Allow root to run any commands anywhere
root ALL=(ALL) ALL
xxx ALL=(root) NOPASSWD:ALL -->这种就是免密码sodu,只是ALL就要密码
2、find:搜索
- find / -name ‘tail’
find / -name ‘tail’
3、安装rpm包
-
yum search httpd
yum install httpd
yum install -y httpdyum uninstall xxx 错误的
4、PATH环境变量/which:
-
witch:查找命令在哪个路径
-
[root@hadoop001 ~]# echo $PATH
/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin[root@hadoop001 ~]# which ls
alias ls=‘ls --color=auto’
/bin/ls
[root@hadoop001 ~]# ls