Discussion:
How to show the full (=uncut) start command in a "ps -ef" output?
(too old to reply)
Brad Shelton
2010-09-17 12:37:55 UTC
Permalink
When I type at the command prompt:

ps -ef|grep foobar

then all the processes which contain the pattern "foobar" are listed.

Unfortunately the last column (=with the start command) is automatically cut after approx. 50 chars.

How can I display the real full, uncut command?

Brad
The Natural Philosopher
2010-09-17 14:01:51 UTC
Permalink
Post by Brad Shelton
ps -ef|grep foobar
then all the processes which contain the pattern "foobar" are listed.
Unfortunately the last column (=with the start command) is automatically cut after approx. 50 chars.
How can I display the real full, uncut command?
Use a terminal that support more than 50 chars?

e.g.

# ps -ef | grep usr
me 598 9795 2 Sep14 ? 02:00:28
/usr/local/firefox/lib/firefox-3.6.8/plugin-container
/usr/lib/flashplugin-nonfree/libflashplayer.so 9795 plugin false
Post by Brad Shelton
Brad
Chris F.A. Johnson
2010-09-17 15:08:38 UTC
Permalink
Post by Brad Shelton
ps -ef|grep foobar
then all the processes which contain the pattern "foobar" are listed.
Unfortunately the last column (=with the start command) is automatically cut after approx. 50 chars.
How can I display the real full, uncut command?
ps -efwww | grep foobar
--
Chris F.A. Johnson, <http://cfajohnson.com>
Author:
Pro Bash Programming: Scripting the GNU/Linux Shell (2009, Apress)
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
adamwonski
2010-09-17 15:56:09 UTC
Permalink
Post by Brad Shelton
ps -ef|grep foobar
then all the processes which contain the pattern "foobar" are listed.
Unfortunately the last column (=with the start command) is automatically cut after approx. 50 chars.
How can I display the real full, uncut command?
Brad
From man ps:
-w Wide output. Use this option twice for unlimited width.
Harald Meyer
2010-09-17 16:52:20 UTC
Permalink
Post by Brad Shelton
ps -ef|grep foobar
How can I display the real full, uncut command?
Add -ww to the parameters, like ps -efww
Moe Trin
2010-09-17 19:39:02 UTC
Permalink
On 17 Sep 2010, in the Usenet newsgroup comp.unix.questions, in article
Post by Brad Shelton
Unfortunately the last column (=with the start command) is
automatically cut after approx. 50 chars.
How can I display the real full, uncut command?
[compton ~]$ whatis ps
ps (1) - report process status
[compton ~]$

w wide output: don't truncate command lines to fit on one
line. To be exact, every w that is specified will add
another possible line to the output. If the space isn't
needed it isn't used. You may up to 100 w's.

So try 'ps efwww' and be overwhelmed.

Old guy
Sven Mascheck
2010-09-18 13:06:39 UTC
Permalink
Post by Brad Shelton
ps -ef|grep foobar
[...]
Unfortunately the last column (=with the start command) is automatically
cut after approx. 50 chars.
The particular behaviour depends on the implementation,
and you haven't mentioned your OS/toolchest release.

The string usually has an upper limit anyway,
but hopefully more than your 50 characters.

Additionally the output might depend on whether ps detects a TTY.
Even just "ps|cat" instead of "ps" yields a longer line length then.
(Your implementation doesn't seem to behave like this, though.)

Some have mentioned the flag or option 'w' (and it's likely
that it works for you).
However, this origins from just one widely available implementation
flavour (BSD), which has made it into several, but not all
implementations. Strongly System V related implementations,
like Solaris, don't know it.

Loading...