# Linux Experts neededB

**URL:** <https://forums.speedlife.net/t/linux-experts-neededb/210628>\
**Category:** NYSpeed Off Topic\
**Created:** [March 29, 2011, 1:27pm UTC](https://forums.speedlife.net/t/linux-experts-neededb/210628 "2011-03-29T13:27:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jzavalinsk](https://yyz2.discourse-cdn.com/flex034/user_avatar/forums.speedlife.net/jzavalinsk/32/5713_2.png) [@jzavalinsk](https://forums.speedlife.net/u/jzavalinsk)\
**Post date:** [March 29, 2011, 1:27pm UTC](https://forums.speedlife.net/t/linux-experts-neededb/210628/1 "2011-03-29T13:27:17Z")

</div>

Basically, I have a random file of users, and I need to sort out which ones have a shell of /bin/bash/ using sed, cut, sort, or awk. This is the file:

root:x:0:0:root:/root:/bin/bash  
daemon:x:1:1:daemon:/usr/sbin:/bin/sh  
bin:x:2:2:bin:/bin:/bin/sh  
sys:x:3:3:sys:/dev:/bin/sh  
sync:x:4:65534:sync:/bin:/bin/sync  
games:x:5:60:games:/usr/games:/bin/sh  
man:x:6:12:man:/var/cache/man:/bin/sh  
lp:x:7:7:lp:/var/spool/lpd:/bin/sh  
mail:x:8:8:mail:/var/mail:/bin/sh  
news:x:9:9:news:/var/spool/news:/bin/sh  
uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh  
proxy:x:13:13:proxy:/bin:/bin/sh  
www-data:x:33:33:www-data:/var/www:/bin/sh  
backup:x:34:34:backup:/var/backups:/bin/sh  
list:x:38:38:Mailing List Manager:/var/list:/bin/sh  
irc:x:39:39:ircd:/var/run/ircd:/bin/sh  
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh  
nobody:x:65534:65534:nobody:/nonexistent:/bin/sh  
libuuid:x:100:101::/var/lib/libuuid:/bin/sh  
syslog:x:101:103::/home/syslog:/bin/false  
messagebus:x:102:107::/var/run/dbus:/bin/false  
avahi-autoipd:x:103:110:Avahi autoip daemon,:/var/lib/avahi-autoipd:/bin/false  
avahi:x:104:111:Avahi mDNS daemon,:/var/run/avahi-daemon:/bin/false  
couchdb:x:105:113:CouchDB Administrator,:/var/lib/couchdb:/bin/bash  
speech-dispatcher:x:106:29:Speech Dispatcher,:/var/run/speech-dispatcher:/bin/sh  
usbmux:x:107:46:usbmux daemon,:/home/usbmux:/bin/false  
haldaemon:x:108:114:Hardware abstraction layer,:/var/run/hald:/bin/false  
kernoops:x:109:65534:Kernel Oops Tracking Daemon,:/:/bin/false  
pulse:x:110:115:PulseAudio daemon,:/var/run/pulse:/bin/false  
rtkit:x:111:117:RealtimeKit,:/proc:/bin/false  
saned:x:112:118::/home/saned:/bin/false  
hplip:x:113:7:HPLIP system user,:/var/run/hplip:/bin/false  
gdm:x:114:120:Gnome Display Manager:/var/lib/gdm:/bin/false  
martin:x:1000:1000:Martin,:/home/martin:/bin/bash  
test1:x:1001:1001::/home/test1:/bin/sh  
user1:x:1002:1002::/home/user1:/bin/bash  
user3:x:1005:1007::/home/user3:/bin/bash  
bob:x:1006:1008:Bob Marley:/home/bob:/bin/bash  
vboxadd:x:999:1::/var/run/vboxadd:/bin/false  
sshd:x:115:65534::/var/run/sshd:/usr/sbin/nologin  
statd:x:116:65534::/var/lib/nfs:/bin/false  
testing:x:1007:1010::/home/testing:/bin/bash  
mysql:x:117:123:MySQL Server,:/var/lib/mysql:/bin/false

I also have to write a pattern matching regular expression that matches 8 characters of lowercase, upper case, numbers and symbols.

I can do basic scripting and what not, I’m just out to lunch on this shit.

Any help would be appreciated.

Cheers

---

<div class="post-metadata">

**Author:** ![JackdUp](https://yyz2.discourse-cdn.com/flex034/user_avatar/forums.speedlife.net/jackdup/32/6015_2.png) [@JackdUp](https://forums.speedlife.net/u/JackdUp)\
**Post date:** [March 31, 2011, 4:32pm UTC](https://forums.speedlife.net/t/linux-experts-neededb/210628/2 "2011-03-31T16:32:53Z")

</div>

grep “/bin/bash” /etc/passwd | awk -F “:” ‘{print $1}’

does that work for you?
