How can I get a full process list in solaris, without truncated lines?

  • Is there a way to generate a full process listing in solaris, without truncated lines? I've tried the ps command, with the following arguments:

      -f                  Generates a full listing. (See below for
                          significance  of columns in a full list-
                          ing.)
    
      -l                  Generates a long listing. (See below.)
    

    So, those both seem to do what I want, however, further down in the ps man page, I find this:

     
     args                    The command with all its arguments as  a
                             string.  The implementation may truncate
                             this value to the  field  width;  it  is
                             implementation-dependent   whether   any
                             further   truncation   occurs.   It   is
                             unspecified     whether    the    string
                             represented is a version of the argument
                             list  as  it  was  passed to the command
                             when it started, or is a version of  the
                             arguments as they may have been modified
                             by the application. Applications  cannot
                             depend  on  being  able  to modify their
                             argument list and having that  modifica-
                             tion  be  reflected in the output of ps.
                             The Solaris  implementation  limits  the
                             string  to  80  bytes; the string is the
                             version of the argument list as  it  was
                             passed to the command when it started.
    

    Which basically says the output is going to be truncated and there is nothing I can do about it. So, I'm coming here. Surely other people have run into this problem and maybe even have a way around it. I'm guessing ps can't do it and so I need to use other tools to do this. Is that accurate?

    Are you talking about the `ps` command? If so then please update the question so that it's clearer.

    Yeah, sorry... my initial tinkering was with the ps command, I've made the question clearer.

  • Marcel G

    Marcel G Correct answer

    10 years ago

    you could try

    pargs <PID>
    

    this gives you a list of all arguments

    or else use an other ps. If run as root (or any user with enough privileges for that matter)

    /usr/ucb/ps auxww
    

    will give you all arguments. Its part of SUNWscpu, "Source Compatibility, (Usr)"

    `pargs` shows the in-process copy of the command line arguments (and optionally the environment). Good to know, thanks!

    this whole /usr/ucb directory is new to me... I like it!

    On Solaris 11, if you use options without a dash (like "/usr/bin/ps auxwww") they will be treated as UCB style options, and the output will show extra long lines, even when you are NOT running as root. This is not well publicized. See also: http://superuser.com/questions/148271/ps-command-in-solaris

License under CC-BY-SA with attribution


Content dated before 6/26/2020 9:53 AM