Results 1 to 8 of 8

Thread: Options in ps command in UNIX

  1. #1
    Contributing Member
    Join Date
    May 2006
    Answers
    75

    Options in ps command in UNIX

    I wanted to know what are the options available with ps command in UNIX ? All I know about ps command is it gives report or statistics about the processes. Any idea on this is also welcome


  2. #2
    Expert Member
    Join Date
    Sep 2006
    Answers
    477

    Re: Options in ps command in UNIX

    I usually give ps-ef to list full details of the processes and to display ALL the processes.

    Here are some refference links.
    http://unixhelp.ed.ac.uk/CGI/man-cgi?ps
    http://en.wikipedia.org/wiki/Ps_(Unix)

    Cheers!
    Kalayama

    [COLOR="Blue"][SIZE="2"]"If you are not living on the edge of your life, you are wasting space"[/SIZE][/COLOR]

    Someone says "Impossible is nothing". The man next him says "Let me see you licking your elbow tip!"

  3. #3
    Junior Member
    Join Date
    Feb 2007
    Answers
    1

    Arrow Re: Options in ps command in UNIX

    Quote Originally Posted by blenda View Post
    I wanted to know what are the options available with ps command in UNIX ? All I know about ps command is it gives report or statistics about the processes. Any idea on this is also welcome
    PLZ HELP. M NT GETTING IT EXACTLY


  4. #4
    Expert Member
    Join Date
    Sep 2006
    Answers
    477

    Re: Options in ps command in UNIX

    Well what is your doubt? Just follow the links I posted, all the necessary details are filed there.

    ps is a Unix command which lista down the processes that are running in the shell. You can pass a lot of arguments to it to get better/desired output for the command.


    Note: When you make a post, please write the entire words. Sure, short forms look fashionable, but there are people who are not smart enough to understand the short forms. For example instead of writing
    PLZ HELP. M NT GETTING IT EXACTLY
    , you could've comfortable written, "Please help me. I am not getting it exactly". See? Sound more " readable ". Also, don't use CAPS unless you want to emphasize a point. (In general CAPS means shout, which is consdered rude).

    Just a few little comments mate. Just to add class to your posts. hope to see a lot of great posts from you.

    Cheers!
    -Kalayama

    Last edited by kalayama; 02-01-2007 at 01:20 PM. Reason: Typo
    [COLOR="Blue"][SIZE="2"]"If you are not living on the edge of your life, you are wasting space"[/SIZE][/COLOR]

    Someone says "Impossible is nothing". The man next him says "Let me see you licking your elbow tip!"

  5. #5
    Junior Member
    Join Date
    Jan 2007
    Answers
    9

    Re: Options in ps command in UNIX

    ps stands for "process status"
    The ps Command is used to display the currently running processes on Unix/Linux systems. If you know the 'Task-Manager" which pops up under Windows NT/2000/XP when you press CTRL+ALT+DEL then you will quickly grasp what ps does on Linux. It can show you the processes on your system in various formats.
    The info provided by kalayama will suffice your need. but just wanted to add a bit more to it.


  6. #6
    Junior Member
    Join Date
    Feb 2007
    Answers
    2

    Re: Options in ps command in UNIX

    Quote Originally Posted by kalayama View Post
    I usually give ps-ef to list full details of the processes and to display ALL the processes.
    On Linux, when you do a "ps -ef" you see a long description of the command. However, if you pipe it to something, eg, "ps -ef | more", the command description is shortened. Same thing if you tried to save it to a file with "ps -ef > /tmp/ps_output".

    How do you maintain the long description in the output of a pipe or cat?

    On Solaris, the long description is kept whether you pipe or cat, so the ps behaves differently between these two OSes.


  7. #7
    Junior Member
    Join Date
    Mar 2007
    Answers
    2

    Re: Options in ps command in UNIX

    simple way of finding answers for such query is "man" on unix system, pl do use of it.

    $ man ps (will list the definition and options with detailed information)

    to search a particular process
    $ ps -aef | grep <name>


  8. #8
    Junior Member
    Join Date
    Feb 2007
    Answers
    2

    Re: Options in ps command in UNIX

    Quote Originally Posted by SureshBV View Post
    simple way of finding answers for such query is "man" on unix system, pl do use of it.

    $ man ps (will list the definition and options with detailed information)

    to search a particular process
    $ ps -aef | grep <name>
    No, they do not mention what happens to ps into a pipe.

    Behavior is drastically different between Unix and Linux.

    On Linux, "ps -aef | grep" truncates the CMD description to 32 chars.

    On Solaris, "ps -aef | grep" truncates to 78 or 79 characters, whereas "/usr/ucb/ps -auxwww" does not truncate the CMD at all.

    But "/usr/ucb/ps" is not available in Linux.

    So I have not been able to find a universal "Unix" solution to get the full CMD with its arguments through ps.

    I saw something about the process information pseudo-filesystem files in /proc on both Solaris and Linux, but not sure is it's possible to get the command and argument information on a process that way. And if it could, would they be compatible between the two OSes.


  9.  Sponsored Ads
    Ad


     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact