![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
cut question
Code:
#!/bin/bash
echo "UserName PID Command"
ps -ef > ps.temp
grep '^[a-z]\{2,3\}[0-9]\{4\}' ps.temp > ps.temp2
cut -f1,2,8 ps.temp2
rm ps.temp*
|
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Why don't you just use the formatted output ps command?
eg: Code:
ps -eo uid,pid,args |
|
#3
|
|||
|
|||
|
yea that does make more sense...thanks!
|
|
#4
|
|||
|
|||
|
the uid displays as the number and not the username...how do i get the username instead of the number?
|
|
#5
|
|||
|
|||
|
Quote:
ps -eo user,pid,args |
|
#6
|
|||
|
|||
|
Now now
(2) No negative comments about others or impolite remarks. Be patient. That's why for some of the questions that would be easily found, I'll post "man find" for example or "a google search found". Carl |
|||
| Google The UNIX and Linux Forums |