How do I extend the terminal width or set term variables with ksh? / Not Getting the full command info from ps in Unix terminal ?

To identify processes to kill we need to view the FULL output from the ps command (we use the comm field). But by default we are not able to view full command.  So here is the solution..

Solaris :

/usr/ucb/ps -awux

You may need two “w” options. From ps(1b):

-w Uses a wide output format (132 columns rather than 80). If the option letter is repeated, that is, -ww, uses arbitrarily wide output. This information is used to decide how much of long commands to print.

AIX / Linux :

I have a putty remote session or any terminal session with ksh shell. When I insert a long command I can see ‘<‘ suddenly appear on the line and my command begins to scroll horizontally between prompt and ‘<‘ sign while I keep on writing it.

I want to make it clear: a ‘<‘ sing does not appear at the end of the visible line (ie. limited by putty window) but in the middle of it. Is there a way to change it to higher value? I tried TERM, but did not set it.

Answer: You have to define $COLUMNS after you login or in .kshrc. Similarly, you can also define $LINES.

Open your .kshrc or edit .kshrc, and add

# echo $SHELL
/usr/bin/ksh
# export COLUMNS=1000
# ps -ef

 

Leave a Comment

Your email address will not be published. Required fields are marked *

CAPTCHA * Time limit is exhausted. Please reload the CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top