1. 程式人生 > >20151202正則第四部分(grep,egrep,sed複習)

20151202正則第四部分(grep,egrep,sed複習)

[[email protected] ~]# sed '20,$s/.*/aaa:&/' 1.txt root:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/bin:/sbin/nologin daemon:x:2:2:daemon:/sbin:/sbin/nologin adm:x:3:4:adm:/var/adm:/sbin/nologin lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin sync:x:5:0:sync:/sbin:/bin/sync shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown halt:x:7:0:halt:/sbin:/sbin/halt mail:x:8:12:mail:/var/spool/mail:/sbin/nologin uucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin operator:x:11:0:operator:/root:/sbin/nologin games:x:12:100:games:/usr/games:/sbin/nologin gopher:x:13:30:gopher:/var/gopher:/sbin/nologin ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin nobody:x:99:99:Nobody:/:/sbin/nologin dbus:x:81:81:System message bus:/:/sbin/nologin usbmuxd:x:113:113:usbmuxd user:/:/sbin/nologin vcsa:x:69:69:virtual console memory owner:/dev:/sbin/nologin rtkit:x:499:497:RealtimeKit:/proc:/sbin/nologin aaa:avahi-autoipd:x:170:170:Avahi IPv4LL Stack:/var/lib/avahi-au                           toipd:/sbin/nologin aaa:pulse:x:498:496:PulseAudio System Daemon:/var/run/pulse:/sbi                           n/nologin aaa:haldaemon:x:68:68:HAL daemon:/:/sbin/nologin aaa:ntp:x:38:38::/etc/ntp:/sbin/nologin aaa:apache:x:48:48:Apache:/var/www:/sbin/nologin aaa:saslauth:x:497:76:"Saslauthd user":/var/empty/saslauth:/sbin                           /nologin aaa:postfix:x:89:89::/var/spool/postfix:/sbin/nologin aaa:abrt:x:173:173::/etc/abrt:/sbin/nologin aaa:gdm:x:42:42::/var/lib/gdm:/sbin/nologin aaa:sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/n                           ologin aaa:tcpdump:x:72:72::/:/sbin/nologin aaa:niejicai:x:500:500:niejicai:/home/niejicai:/bin/bash aaa:hacluster:x:496:493:heartbeat user:/var/lib/heartbeat/cores/                           hacluster:/sbin/nologin aaa:xiaonie:x:501:501::/home/xiaonie:/bin/bash aaa:user1:x:502:503::/home/user1:/bin/bash aaa:user2:x:5505:5505::/home/user2:/bin/bash aaa:user10:x:5506:5507::/home/user10:/bin/bash aaa:user20:x:505:505::/home/user20:/bin/bash aaa:user41:x:5562:500::/home/user41:/bin/bash aaa:user42:x:5561:500::/home/user42:/bin/bash aaa:user4:x:509:500:user4,ddddddddddd,aaaaaaaaaaa,11111111111111                           1:/home/user444:/bin/bash aaa:user0:x:5563:5563::/home/user0:/bin/bash