日期:2014-05-16  浏览次数:20696 次

linux脚本捡漏(1)

1.linux中如何判断某用户是否存在?

用户:test

命令:more /etc/passwd |grep test

2.linux添加用户相应的操作

用户:test

命令:

切换到能执行的用户比如root

useradd test?

passwd test 提示输入

usermod ?-G groupname test

3.linux集群命令统一管理有什么好的方式吗?

推荐:LazyManage

4.su到root之后执行shell命令出现bash: **: command not found?

解决方式:su -?

5.scp

scp local_file remote_username@remote_ip:remote_file?

6.执行shell脚本的时候出现Too many arguments. Usage:?

问题:里面有中文或者多余的空格

解决:检查脚本是否有中文空格或者有不该有的空格

7.linux环境变量中有重复的时候是配置在PATH后的起作用还是配置在PATH前的起作用?

答:后的起作用