Answer the question
In order to leave comments, you need to log in
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
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
1) either really use ax, or even describe the columns that you need yourself.
You can also choose not to display only the required columns:
$ ps -o comm,pid -C sshd
COMMAND PID
sshd 1504
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.
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).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question