03-11-2013
3,
0
Join Date: Mar 2013
Last Activity: 11 March 2013, 6:01 PM EDT
Posts: 3
Thanks Given: 0
Thanked 0 Times in 0 Posts
Cut pid from ps using cut command
hay
i am trying to get JUST the PID from the ps command.
my command line is:
ps -ef | grep "mintty" | cut -d' ' -f2
but i get an empty line. i assume that the delimiter is not just one space character, but can't figure out what should i do in order to do that.
i know i can use awk or cut -c1-4 (the pid is in characters 1-4), but i don't want to use them.
is it possible to achieve my goal using cut -f and a combination or -d or -s?
thanks