3

Is there a way to get the full output from ps on Cygwin?

For instance, none of the following gives me the full wget shell line, just /usr/bin/wget:

$ ps -ef | grep wget
Administ    9844    7780 pty1     13:22:57 /usr/bin/wget
Administ    8036   12648 pty0     13:18:15 /usr/bin/wget
Administ    4832   11828 pty2     13:23:42 /usr/bin/wget

$ ps awx | grep wget
     9844    7780    9844      10264  pty1      197108 13:22:57 /usr/bin/wget
     8036   12648    8036      10060  pty0      197108 13:18:15 /usr/bin/wget
     4832   11828    4832      10780  pty2      197108 13:23:42 /usr/bin/wget

$ ps -p 9844 | cat
      PID    PPID    PGID     WINPID   TTY         UID    STIME COMMAND
     9844    7780    9844      10264  pty1      197108 13:22:57 /usr/bin/wget
  • Have you tried ps -efl? This is what I normally use for a long listing in Linux. Or you can use -o and specify the columns you want to see. I don't know if these options are available in Cygwin. – AFH Sep 6 '17 at 10:57
  • Thanks @AFH: alas, (on Cygwin) ps -efl gives the same output as ps -ef. – boardrider Sep 8 '17 at 9:59
4

As you can see from cygwin ps manual the command line is not reported.

It is however available under /proc/process_PID/cmdline

1

This prints all Cygwin processes and it's command line, however without spaces:

grep -a "" /proc/*/cmdline

-a tells grep to show content of binary files (cmdline is binary, not text)

"" tell to match to everything. You can replace it to the name of process you are interested

$ grep -a "" /proc/*/cmdline /proc/10236/cmdline:/usr/bin/mintty-i/Cygwin-Terminal.ico- /proc/11340/cmdline:-bash /proc/11672/cmdline:sshslavik@dev.slavikf.local ...

if you want to preserve spaces in command line, do this:

grep -a "" /proc/*/cmdline | xargs -0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.