在路由器串口,或者xterm远程web终端执行ps w命令的时候,命令显示不全,好像最多只显示80列宽。这个原因是tty的默认宽度是80。
ps会读取这个宽度,超过的截断了,如下:
149 root 0:00 netd
151 root 0:00 [kworker/0:3-ipv]
152 root 0:00 /sbin/udhcpc -i eth0 -p /run/netd/udhcpc.eth0.pid -s /lib/
154 nobody 0:47 /usr/sbin/dnsmasq -k -C /etc/dnsmasq.conf -C /run/netd/dns
155 root 8h53 /usr/sbin/hostapd -P /run/netd/hostapd-ap5g.pid -i ap5g /r
157 root 8h16 /usr/sbin/hostapd -P /run/netd/hostapd-ap2g.pid -i ap2g /r
160 root 0:02 boa -c / -f /etc/boa/boa.conf
161 root 0:00 init
使用stty设置列宽:
# stty cols 200
设置之后ps w可以显示命令的所有参数
149 root 0:00 netd
151 root 0:00 [kworker/0:3-ipv]
152 root 0:00 /sbin/udhcpc -i eth0 -p /run/netd/udhcpc.eth0.pid -s /lib/netd/dhcpc.sh -f -R -t 3 -T 3 -A 20
154 nobody 0:47 /usr/sbin/dnsmasq -k -C /etc/dnsmasq.conf -C /run/netd/dnsmasq.conf --servers-file /run/netd/dnsmasq-server.conf -x /run/netd/dnsmasq.pid
155 root 8h53 /usr/sbin/hostapd -P /run/netd/hostapd-ap5g.pid -i ap5g /run/netd/hostapd-ap5g.conf
157 root 8h16 /usr/sbin/hostapd -P /run/netd/hostapd-ap2g.pid -i ap2g /run/netd/hostapd-ap2g.conf
160 root 0:02 boa -c / -f /etc/boa/boa.conf
161 root 0:00 init
使用stty size可以查看行和列数
# stty size
10 200
参考
https://www.mkssoftware.com/docs/man1/stty.1.asp