[20191106]善用column格式化輸出.txt
[20191106]善用column格式化輸出.txt
# man column
DESCRIPTION
The column utility formats its input into multiple columns. Rows are filled before columns. Input is taken from
file operands, or, by default, from the standard input. Empty lines are ignored.
-t Determine the number of columns the input contains and create a table. Columns are delimited with
whitespace, by default, or with the characters supplied using the -s option. Useful for pretty-printing
displays.
--//可以利用格式化輸出獲得好的顯示效果,例子如下:
$ mount
/dev/sda1 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
/dev/sda2 on /tmp type ext4 (rw)
/dev/sda5 on /u01 type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
--//mount的顯示連線在一起,不好檢視.而假如column -t
$ mount | column -t
/dev/sda1 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
/dev/sda2 on /tmp type ext4 (rw)
/dev/sda5 on /u01 type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
--//這樣就好看了.再比如:
# ss -nop
--//顯示太寬了.不貼出結果.而加入column -t過濾,顯示如下:
# ss -nop | column -t
State Recv-Q Send-Q Local Address:Port Peer Address:Port
ESTAB 0 0 192.168.100.78:1521 192.168.100.78:23591 timer:(keepalive,4.213ms,0) users:(("tnslsnr",29630,12))
ESTAB 0 0 192.168.100.78:23591 192.168.100.78:1521 users:(("oracle",54271,10))
ESTAB 0 44 192.168.100.78:22 192.168.98.6:53411 timer:(on,402ms,0) users:(("sshd",45671,3))
ESTAB 0 0 192.168.100.78:12260 192.168.100.78:1521 users:(("oracle",57162,10))
ESTAB 0 0 192.168.100.78:22 192.168.98.6:51190 timer:(keepalive,50sec,0) users:(("sshd",45348,3))
ESTAB 0 0 192.168.100.78:1521 192.168.100.78:12260 timer:(keepalive,33sec,0) users:(("tnslsnr",29630,13))
--//這樣就好看許多.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2662833/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [20200306]expand格式化輸出.txt
- [20191106]隱式轉換.txt
- 格式化輸入輸出
- 善用 Format 來格式化字串ORM字串
- 格式化輸出
- 格式化輸入和輸出
- 格式化輸出 22
- pythonformat格式化輸出PythonORM
- [20191106]12c DCD SQLNET.EXPIRE_TIME.txtSQL
- python字串格式化輸出Python字串格式化
- 字串拼接格式化輸出字串
- 格式化輸出變數工具變數
- 練習3(格式化輸出)
- Python 字串格式化輸出方式Python字串格式化
- hadoop 自定義格式化輸出Hadoop
- [20190524]sqlplus 與輸出&.txtSQL
- [20200904]12c invisible column impdp segment_column_id.txt
- Go 語言中的格式化輸出Go
- 格式化輸出的幾種方式
- shell指令碼(3)-格式化輸出指令碼
- [20220822]奇怪的ashtop輸出.txt
- [20211111]奇怪的ashtop輸出.txt
- [20210924]awk奇怪的輸出.txt
- [20191119]探究ipcs命令輸出.txt
- [20200317]NULL與排序輸出.txtNull排序
- Java™ 教程(格式化數字列印輸出)Java
- Golang中的格式化時間輸出Golang
- 第四章 字串和格式化輸入/輸出字串
- [20191112]SQL Tuning by adding column alias (2).txtSQL
- [20210902]cut使用輸出問題.txt
- [20190720]sqlplus 與輸出& 2.txtSQL
- [20210301]延遲顯示輸出.txt
- [20210419]避免冗餘的輸出.txt
- GsonBuilder匯出null值、格式化輸出、日期時間UINull
- c語言中資料的格式化輸出C語言
- Python3:格式化輸出之format方法PythonORM
- [20210528]V$INDEXED_FIXED_COLUMN檢視.txtIndex
- [20241112]無法理解sqlplus的輸出.txtSQL