Couple unix commands

Hi ! I'm very noob and just started to learn unix. I have readed the manual but I still have many problems. Like, could you help me with these?

===================================================================
1. How can I print users which are running some process, like pine? I just wan't to print usernames, and maybe that process name.
Am I even close? find -user -a | ps -a | grep pine   That gives error from that "-user -a" but prints something...
===================================================================

2. How can I cut some text from these lines? Am I even close? grep FINDTHIS /user/file | cut ????

1:x:1078:FINDTHIS JEE, sometext, more
1:x:10523:FINDTHIS JEE, yeah, some again, something
4:xx:105233:FINDTHIS PLOM, plaaplaa, jeh
1:x:1078:FINDTHIS PLIM, foo, jeh
2:x:104:FINDTHIS FOO, fighter, foo, foo

So I have those lines in file, I wan't to cut ONLY text between ':' and ',' That should produce only these lines:

FINDTHIS JEE
FINDTHIS JEE
FINDTHIS PLOM
FINDTHIS PLIM
FINDTHIS FOO

How can I do it?
===================================================================

3. How to print ALL system's useraccount names, and ONLY names, and ONLY each accountname ONCE? And that list should be in alphabetical order and reverse.

===================================================================

4. How to count and print the number result for this? User's which are running some process, like pine, and count each user ONLY ONCE.

===================================================================

5. I have large txt file. How can I print results which comes from only lines 50-60 and chars 10-15 from each line?




Thanks..

And I have done this--> rtfm... Still can't do those :) But almost.. Help?
exciiAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

amit_gCommented:
ps -a | grep pine

cut -d: -f4 /user/file | cut -d, -f1

cut -d: -f1 /etc/passwd | sort -u -r

Show the sample output of ps -a | grep pine The count would be something like

head -60 FileName | tail -11 | cut -c10-15
ozoCommented:
find -user takes an argument
man find
     -user uname
             True if the file belongs to the user uname.  If uname is numeric
             and there is no such user name, then uname is treated as a user
             ID.

perl -pe 's/.*:(.*?),.*/$1/' <<EOF
1:x:1078:FINDTHIS JEE, sometext, more
1:x:10523:FINDTHIS JEE, yeah, some again, something
4:xx:105233:FINDTHIS PLOM, plaaplaa, jeh
1:x:1078:FINDTHIS PLIM, foo, jeh
2:x:104:FINDTHIS FOO, fighter, foo, foo
EOF

perl -e 'print "$_\n" while $_ = getpwent()'

ps -u | grep -w '[p]ine'  | cut -f1 -d" " | sort -u | wc

sed -n 50,60p txtfile | cut -c 10-15
brettmjohnsonCommented:
1.  ps -ax -o"user,command" | grep pine | grep -v grep

2. grep FINDTHIS /user/file | cut -d"," -f1 | cut -d":" -f4

3. awk -F: '{ if (NF == 7) print $1}' /etc/passwd | sort -r

4. ps -ax -o"user,command" | grep pine | grep -v grep | cut -d" " -f1 | uniq
      [ to get the count, pipe the output through 'wc -l' ]
   
5.  head -60 largefile.txt | tail -10 | cut -c10-15

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
exciiAuthor Commented:
Each one was helpfull, thanks. 50p to each one.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.