[hadoop@Master bin]$ su
abc mongod mongofiles mongoperf mongostat
bsondump mongodump mongoimport mongorestore mongotop
bsondump mongodump mongoimport mongorestore mongotop
mongo mongoexport mongooplog mongos
mongod mongofiles mongoperf mongostat
[hadoop@Master bin]$
Password:
进入root用户;
[root@Master bin]# visudo
编辑修改/etc/sudoers配置文件;
在文件中,找到下面这一行:
root ALL=(ALL) ALL
在它的下面再添加一行,其中hadoop为普通用户名:
hadoop ALL=(ALL) ALL
退出到普通用户:
[root@Master bin]# exitexit
创建一个文件,名为abc:
[hadoop@Master bin]$ sudo mkdir abc[sudo] password for hadoop:
查看是否创建成功:
[hadoop@Master bin]$ lsabc mongod mongofiles mongoperf mongostat
bsondump mongodump mongoimport mongorestore mongotop
mongo mongoexport mongooplog mongos
删除名为abc的文件:
[hadoop@Master bin]$ sudo rm -rf abc
查看是否删除成功:
[hadoop@Master bin]$ lsbsondump mongodump mongoimport mongorestore mongotop
mongo mongoexport mongooplog mongos
mongod mongofiles mongoperf mongostat
[hadoop@Master bin]$