The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Using all numeric for username aryamahzar SUN Solaris 5 06-14-2008 11:51 AM
changing my username? Bashar Post Here to Contact Site Administrators and Moderators 4 07-08-2007 02:04 PM
Get username in script willc0de4food Shell Programming and Scripting 9 02-13-2007 03:00 AM
How can I enlarged the font size? new_hand UNIX for Dummies Questions & Answers 0 09-10-2005 10:42 AM
Username length rod23 SUN Solaris 1 11-06-2004 03:05 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-30-2008
GSalisbury GSalisbury is offline
Registered User
  
 

Join Date: Apr 2002
Location: New Jersey
Posts: 12
Can username col be enlarged in ps output

Principally concerned with RedHat Linux (EL3+).

When using a ps command that includes the username in the output line is there a way to enlarge the size of the column.

It appears that presently that column is limited to 8 characters and if an id is larger than that the uid is used. That makes lookups etc. somewhat more awkward and plays havoc with scripts that need to do things based upon extracting a username from a ps line.

Is there some way to increase the size of ps' username output?

Thx.
G. Salisbury
Long Valley, NJ
  #2 (permalink)  
Old 10-11-2008
otheus's Avatar
otheus otheus is offline Forum Staff  
Moderator ala Mode
  
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 1,886
I thought that officially, user names were limited to 8 characters long in distinction. That is, you can have a name longer than that, but comparisons will stop after 8 characters. I'm not totally sure, though.

In Linux, the ps command is highly versatile. You can do something like "ps -o uid,cmd" just to output those two field. Check the man page for all the gory details of the -o option. Moreover, you can get the uid directly from the /proc filesystem if you know the PID. Look at the directory /proc/$$. You'll find the uid hiding in plain sight or in the "stat" output (which is cryptic) or in the owner of the directory itself.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:18 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0