Loading ...
Sorry, an error occurred while loading the content.

Re: [redhat] how to use PS to identify arguments, or how to use BSD ps in RHEL6

Expand Messages
  • Cameron Simpson
    ... Did you look at man ps on a RHEL6 system. That is where to start. ps on RedHat systems is GNU ps. It will accept your BSD ps arguments. But better is
    Message 1 of 2 , Jul 19, 2013
    • 0 Attachment
      On 19Jul2013 14:37, daniel hyatt <hyattdj@...> wrote:
      | I have a script which uses PS command to identify the command and arguements the command was fired off wiht.
      | /usr/ucb/ps -auxww
      |
      | We are moving from Solaris to RHEL6 and I would rather do this
      | in system V (posix compliance) PS, but one way or another I need
      | to get the arguements.
      |
      | Any ideas?
      | Of course I looked at google, and looked for bsd commands on RHEL6 no such luck.

      Did you look at "man ps" on a RHEL6 system. That is where to start.

      "ps" on RedHat systems is GNU ps. It will accept your BSD ps arguments.

      But better is that most modern "ps" imple,entations take a -o option
      to format the output. So something like:

      ps -o args -p $$ | sed 1d

      would get the current process' command line (after stripping the
      "ps" header row using sed).

      Or:

      ps -o 'pid args' -ax

      etc.

      It is all in the manual.

      Cheers,
      --
      Cameron Simpson <cs@...>

      Yes, some GNOME developers are self-appointed control freak antifeature nazis
      who've stripped functionality in pursuit of some theoretical "non geek" user
      who does not exist, thereby crippling their software.
      And probably some KDE developers are feature sluts who never saw a checkbox
      they didn't love, exposing users to all kinds of broken features.
      - Nat Friedman in the Gnome usability mlist, 13dec2005
    Your message has been successfully submitted and would be delivered to recipients shortly.