A
A
afiskon2011-05-12 13:33:43
*nix-like systems
afiskon, 2011-05-12 13:33:43

A couple of "lamer" questions for UNIX connoisseurs?

I've actually been working with unixes for quite some time, but still haven't found a solution for the following problems.

1. The ps command cuts the list of processes to fit the width of the terminal. In this regard, the command ps uax | grep ssh may not output anything even if there are processes with the corresponding name, because their names will be truncated. What to do?

2. Sometimes it happens that you go to the server via ssh, work, and at some point you realize that you need to change the size of the terminal. So, sometimes after that, long commands are cut off at the _old_ terminal boundary and begin to be entered over the bash prompt. Should there be a command or keyboard shortcut for this case?

Answer the question

In order to leave comments, you need to log in

13 answer(s)
M
Maxim, 2011-05-12
@maxout

in the comments tin%)
essentially:
1. ps auxwww
2. reset

S
Sergey, 2011-05-12
@bondbig

-w,w wide output

E
Eugene, 2011-05-12
@immaculate

1) read the entire command line of the desired process:
xargs -0 echo < /proc/$pid/cmdline
Also:
ps ax --width=$COLUMNS
2) did not encounter this, but the reset command should definitely help

I
Ilgiz, 2011-05-12
@kegf

ps axww. in fr a little differently.

S
Stamm, 2011-05-12
@Stamm

1) You can try to display less information: ps ax | grep ssh

M
mark_ablov, 2011-05-12
@mark_ablov

1) either really use ax, or even describe the columns that you need yourself.

B
bobahPhD, 2011-05-12
@bobahPhD

1)ps -p $(pidof ssh)
2) you can try clear or reset

I
Ilgiz, 2011-05-12
@kegf

in the physical console resolution is changed by vidcontrol'om.

K
Kane, 2011-05-12
@Kane

You can also choose not to display only the required columns:

$ ps -o comm,pid -C sshd
COMMAND           PID
sshd             1504

K
Kane, 2011-05-12
@Kane

You can use the reset command to reset the terminal.

A
AnViar, 2011-05-12
@AnViar

2) win+up, win+down in win7+putty will resize the window if this is the case. It seems to me that sticking occurs if the resize occurred at the time the command was executed in the console and the terminal lost the event.

V
Vlad Zhivotnev, 2011-05-12
@inkvizitor68sl

Regarding the second point - CTRL + L in the bash, clear, if it doesn’t help, then the reset command will definitely help (this is the complete reinitialization of the terminal).

B
Balthasar, 2011-05-13
@Balthasar

1) "ps uax | grep ssh" in this case, the output of ps does not go to the terminal and the width should not be taken into account.
At least it's like this for me: My terminal is a little narrower than 4161 familiarity.
$ ps aux | wc -L
4161

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question