Full command text with unix ps

39

6

When we enter:

ps -f

... the CMD column text doesn't show the full command. Any way to prevent this truncating?

Seems like it's showing the first 80 characters. We are running a fairly log command that has lots of command line switches.


Thanks for the responses.. doesn't seem like any of these do the trick though..

Marcus Leon

Posted 2009-06-19T15:02:57.517

Reputation: 2 323

Answers

39

Pipe the result into cat .. that'll ignore your terminal settings.

ps -f | cat

eduffy

Posted 2009-06-19T15:02:57.517

Reputation: 641

21

I found this on my FreeBSD's 9 ps man page:

-w Use 132 columns to display information, instead of the default which is your window size. If the -w option is specified more than once, ps will use as many columns as necessary without regard for your window size. Note that this option has no effect if the “command” column is not the last column displayed.

So:

ps auxww

Did what I wanted.

HTH!

FloFu

Posted 2009-06-19T15:02:57.517

Reputation: 311

3+1 for not involving any other command. ps -fww (using UNIX options syntax) works too. – Melebius – 2015-05-14T05:52:34.703

1Confused why this isn't the most popular answer. – Adam Mackler – 2014-05-19T14:03:04.527

11

ps detects the size of your terminal window and clips to that.

Solution: don't output directly to the terminal!

ps -f | less

rix0rrr

Posted 2009-06-19T15:02:57.517

Reputation: 801

11

If /usr/ucb dir exists then you may try following command

/usr/ucb/ps -auxww | grep java

Prashant Bhate

Posted 2009-06-19T15:02:57.517

Reputation: 775

3

man ps:

-w Use 132 columns to display information, instead of the default which is your window size. If the -w option is specified more than once, ps will use as many columns as necessary without regard for your window size. When output is not to a terminal, an unlimited number of columns are always used.

Hence

ps -f | cat

works

Hardy

Posted 2009-06-19T15:02:57.517

Reputation: 130

0

more works perfectly for me

ps -ef |more

Maoz Zadok

Posted 2009-06-19T15:02:57.517

Reputation: 101

0

G'day,

Don't forget that -eaf works with normal ps only and not luddite ucb ps.

Ucb ps uses multiple -w options to give you the complete command line.

HTH

cheers,

Rob Wells

Posted 2009-06-19T15:02:57.517

Reputation: 400