以添加用户user1(UID=550GID=550)为例:用管理员root账户进入shell:#vi/etc/group在末尾按格式添加:user1:x:550:#wq#vi/etc/passwd在末尾添加:user1:x:550:550::/home/user1:/bin/bash#wq#vi/etc/shadow在末尾添加:user1:!!:16875:0:99999:7:::(其中个字段的意义:1)“登录..
分类:
系统相关 时间:
2016-03-16 01:33:41
阅读次数:
273
1.1 /etc/passwd文件内容格式 该目录存储的是操作系统用户信息,该文件为所有用户可见 用户名: 密码 : uid : gid :用户描述:主目录:登陆shell 举个例子: 可以看出/etc/passwd文件存放的是用户的信息,由6个分号组成的7个信息,解释如下
分类:
其他好文 时间:
2016-03-14 12:10:02
阅读次数:
189
Linux常用命令之一:findfind,find在不指定查找目录的情况下是对整个系统进行遍历查找使用格式:find[指定查找目录][查找规则][查找完后执行的action][指定查找目录]例如:[root@test~]#find/etc-name"passwd"/etc/passwd/etc/pam.d/passwd[查找规则](1)根据文件名查找#-name..
分类:
系统相关 时间:
2016-03-13 18:21:12
阅读次数:
182
八、shell脚本sed&awk01.sed的使用流编辑器-Steam Editor#ed /etc/passwd1,10p……1s/root/byf/p(替换root为byf)#sed -e 's/root/byf/g' /etc/passwd(功能同上)只是显示出来的内容更改#sed -e 's
分类:
系统相关 时间:
2016-03-13 17:55:18
阅读次数:
195
语法:cut-d‘分隔字符’[-cf]n这里的n是正整数。c和f后和数字之间可以有空格,也可不用。-d后面跟指定分隔符,用单引号引起来。-f指定第几段,以分隔符为界限分段。-f后可以接一个数字,也可以接多个,用逗号连接。cat/etc/passwd|cut-d‘:‘-f2,3,4-c后接数字,表示截取第几个..
分类:
其他好文 时间:
2016-03-10 02:01:05
阅读次数:
308
七. grep家族: 1. grep退出状态: 0: 表示成功; 1: 表示在所提供的文件无法找到匹配的pattern; 2: 表示参数中提供的文件不存在。 见如下示例: /> grep 'root' /etc/passwd root:x:0:0:root:/root:/bin/bash opera
分类:
系统相关 时间:
2016-03-07 11:55:18
阅读次数:
221
1、选项 -F 域分隔符 -f 指定awk脚本文件 示例: cat /etc/passwd | awk -F ':' 'BEGIN{print "name,shell"} /root/{print $1","$7} END{print "~~end"}' 为M为单位统计某个文件夹下字节数: ls -
分类:
其他好文 时间:
2016-03-04 22:24:06
阅读次数:
170
car/etc/passwd查看用户名文件[root@one~]#cat/etc/passwd
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin/etc/passwd有:分割成7个字段,每个字段的含义如下:1:用户名2:用户密码;基于安全原因,密码存放在/e..
分类:
其他好文 时间:
2016-03-02 22:15:08
阅读次数:
119
1.查看文件指令:cat tail head tac,more ,less 大家比较常用的是cat ,例如cat /etc/passwd 而当查看log时,因为需要关注的往往是最新的内容,则往往用到的指令是tail 如,tail /var/maillog 而tac 输出的内容是与cat顺序相反的,最
分类:
系统相关 时间:
2016-03-02 20:08:37
阅读次数:
227
#cat/etc/passwd root:x:0:0:Superuser:/: daemon:x:1:1:Systemdaemons:/etc: bin:x:2:2:Ownerofsystemcommands:/bin: sys:x:3:3:Ownerofsystemfiles:/usr/sys:
分类:
系统相关 时间:
2016-03-02 11:08:06
阅读次数:
168