1、题目1
取出password中shell出现的次数
解析:
好,让取出password中shell出现的次数,笔者用的是ubuntu,/etc/passwd就是所谓的password文件,那咱们先看看/etc/passwd中文件的格式吧
1 root:x:0:0:root:/root:/bin/bash
2 daemon:x:1:1:daemon:/usr/sbin:/bin/sh
3 bin:x:2:2:bin:/bin:/bin/sh
4 sys:x:3:3:sys:/dev:/bin/sh
5 sync:x:4:65534:sync:/bin:/bin/sync
6 games:x:5:60:games:/usr/games:/bin/sh
7 man:x:6:12:man:/var/cache/man:/bin/sh
8 lp:x:7:7:lp:/var/spool/lpd:/bin/sh
9 mail:x:8:8:mail:/var/mail:/bin/sh
10 news:x:9:9:news:/var/spool/news:/bin/sh
11 uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
12 proxy:x:13:13:proxy:/bin:/bin/sh
13 www-data:x:33:33:www-data:/var/www:/bin/sh
14 backup:x:34:34:backup:/var/backups:/bin/sh
15 list:x:38:38:Mailing List Manager:/var/list:/bin/sh
16 irc:x:39:39:ircd:/var/run/ircd:/bin/sh
17 gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
18 nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
19 libuuid:x:100:101::/var/lib/libuuid:/bin/sh
20 dhcp:x:101:102::/nonexistent:/bin/false 21 syslog:x:102:103::/home/syslog:/bin/false 22 klog:x:103:104::/home/klog:/bin/false 23 hplip:x:104:7:HPLIP system user,,,:/var/run/hplip:/bin/false
笔者只拿23行,总共应该更多,好了 那咱们看一看
1 root:x:0:0:root:/root:/bin/bash
这个是以:为分割符号的,写的都是什么内容呢?