When I use the top command in linux terminal:
top -c
the output like this:
top - 21:54:17 up 197 days,  6:34,  1 user,  load average: 0.10, 0.65, 1.47
Tasks: 255 total,   1 running, 200 sleeping,   0 stopped,  54 zombie
%Cpu(s):  6.0 us,  4.5 sy,  0.0 ni, 87.4 id,  0.5 wa,  1.0 hi,  0.5 si,  0.0 st
MiB Mem :   3625.3 total,    119.0 free,   2408.5 used,   1097.9 buff/cache
MiB Swap:      0.0 total,      0.0 free,      0.0 used.    936.8 avail Mem
    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
1398379 root      20   0 2498248  92148  20716 S   3.0   2.5   2055:04 /usr/bin/kubelet --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/k+
1403326 root      20   0 1892712 560052  27112 S   2.7  15.1   2502:04 kube-apiserver --advertise-address=172.31.227.20 --allow-privileged=true --authorization-mode=Node+
1428214 root      20   0 1402944 125200   9776 S   1.3   3.4 801:06.55 cilium-agent --config-dir=/tmp/cilium/config-map
3848379 root      20   0  269028  27268   7500 S   1.3   0.7 256:37.39 /usr/local/aegis/aegis_client/aegis_12_43/AliYunDunMonitor
 791206 root      20   0  125488  17484  11720 S   1.0   0.5   0:00.10 /usr/local/aegis/AliSecCheck/AliSecCheck -t rtap -c Rtap20483038711736690048
1399005
I can see part of the command content, how to auto wrap the command when the commend is too long? I have tried:
[root@iZm5e2jhfbrshckqh6qdbuZ poemhub]# top -bcn1 -w100
top - 21:55:33 up 197 days,  6:35,  1 user,  load average: 0.47, 0.70, 1.42
Tasks: 252 total,   2 running, 196 sleeping,   0 stopped,  54 zombie
%Cpu(s):  5.9 us,  5.9 sy,  0.0 ni, 85.3 id,  0.0 wa,  2.9 hi,  0.0 si,  0.0 st
MiB Mem :   3625.3 total,    139.8 free,   2395.4 used,   1090.1 buff/cache
MiB Swap:      0.0 total,      0.0 free,      0.0 used.    949.4 avail Mem
    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
 866186 root      20   0   22024   4932   3432 S   6.2   0.1   7:10.58 ./cv-render
1398379 root      20   0 2498248  89164  20720 S   6.2   2.4   2055:06 /usr/bin/kubelet --bootstra+
1404790 65532     20   0 1287016  21224      0 S   6.2   0.6 206:58.70 /coredns -conf /etc/coredns+
      1 root      20   0  387308   7460   3072 S   0.0   0.2   1324:21 /usr/lib/systemd/systemd --+
      2 root      20   0       0      0      0 S   0.0   0.0   0:04.12 [kthreadd]
      3 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 [rcu_gp]
      4 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 [rcu_par_gp]
this just hidden the output, not wrap the output, I still want to see the full output. I also tried like this:
top -c -w 512|fold -w 120 -s
the wrap works, but the command did not output the full, just using + at the end of command.



topinto thinking the terminal is 1000 columns wide and 15 rows high withstty cols 1000 rows 15kind of works for me.