Linux基础知识三

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 httpd

    yum 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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值