LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-11-2003, 01:17 PM   #1
mriolo
LQ Newbie
 
Registered: Feb 2003
Distribution: RH AS 2.1 (7.2)
Posts: 11

Rep: Reputation: 0
Question ps output


Can anyone tell me why sometimes the output of ps with -f displays the uid as the numerical id, and sometimes it displays the name?

Thanks,
Matt

(RH Adv Srv 2.1 - [7.2 kernel])
 
Old 03-11-2003, 01:57 PM   #2
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
-f does full listing
f ASCII-art process hierarchy (forest)
--forest ASCII art process tree

try these:

ps -f
ps f
ps auxf

You will notice the difference.

Last edited by micxz; 03-11-2003 at 01:58 PM.
 
Old 03-11-2003, 02:58 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912
Of course you can always try
man ps
for more indepth information ;)

Cheers,
Tink
 
Old 03-11-2003, 04:14 PM   #4
mriolo
LQ Newbie
 
Registered: Feb 2003
Distribution: RH AS 2.1 (7.2)
Posts: 11

Original Poster
Rep: Reputation: 0
I guess the man pages might help if the output wasn't changing for the same command line syntax.... See below for specifics.

In these examples:
uid username
505 ggilman
506 ecummings
507 cmathews
508 hpriest
509 droche

Prior to reboot.....

#ps -fC pro
506 3452 3451 0 09:44 pts/28 00:00:00 pro UNK MEG
cmathews 3612 3611 0 10:16 pts/14 00:02:50 pro UNK MEG
506 3688 3687 0 10:19 pts/32 00:00:13 pro UNK MEG
hpriest 3741 3740 0 12:02 pts/8 00:00:47 pro UNK MEG
droche 3802 3801 0 12:27 pts/16 00:00:00 pro UNK MEG
ggilman 3810 3809 0 12:34 pts/10 00:00:00 pro UNK MEG

After rebooting.....

#ps -fC pro
ecummings 212 211 0 14:24 pts/3 00:00:00 pro UNK MEG
hpriest 244 243 0 14:30 pts/5 00:00:00 pro UNK MEG
509 253 252 0 14:33 pts/6 00:00:00 pro UNK MEG
507 260 259 0 14:35 pts/7 00:00:00 pro UNK MEG

It seems as though once linux determines, whether based on some reason or randomly, whether it will use the number or the name, it maintains it for that user consistently, at least while they are connected.
 
Old 03-11-2003, 04:31 PM   #5
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
I now see your point. This is a very good question.
 
Old 03-11-2003, 05:27 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912
Ooops ... that *IS* a weird thing, I admit, never seen anything
like that before. Thanks for posting the output like that.

Seems like ps falls over in reading passwd properly there...

Cheers,
Tink
 
Old 03-12-2003, 09:47 AM   #7
mriolo
LQ Newbie
 
Registered: Feb 2003
Distribution: RH AS 2.1 (7.2)
Posts: 11

Original Poster
Rep: Reputation: 0
The answer seems to be, that any usernames that are longer than 8 characters display by uid ....
 
Old 03-12-2003, 10:31 AM   #8
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
Well, according to the post-reboot output, "ecummings" was displayed and it is over 8 characters in length. Also, the second output did not print the username for ID 509: droche (which is less than 8)... Does anybody know where the source for ps is? If ever in doubt, the source will tell all...
 
Old 03-12-2003, 10:35 AM   #9
mriolo
LQ Newbie
 
Registered: Feb 2003
Distribution: RH AS 2.1 (7.2)
Posts: 11

Original Poster
Rep: Reputation: 0
I didn't cut and paste the output - I retyped on one machine from the other, and substitued the usernames in myself - unscientific results ... spankin' for me.
 
Old 03-12-2003, 10:58 AM   #10
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
Hehehe... ok. I'll excuse it just this once...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
No output through SPDIf, but analog works. How do I get output through SPDIF? seanwnz Linux - General 11 11-08-2007 11:24 AM
tv output Shibby Linux - Software 1 06-07-2005 11:35 AM
Via AC'97 5.1 Optical Output or Audigy 4.1 Output Nza Fedora 3 06-01-2004 07:49 AM
the sound gives output when using mic but no output when run a music file medo Debian 0 04-19-2004 07:17 PM
Output of ls -l Crashed_Again Linux - Newbie 4 12-11-2003 06:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration