Linux column命令详解

来源:互联网 发布:汇率软件评论 编辑:程序博客网 时间:2024/05/16 15:36

column命令用于格式化列信息。

column命令的使用格式如下:

column [-tx] [-c columns] [-s sep] [file ...]

常用的选项

-c      Output is formatted for a display columns wide.

-s      Specify a set of characters to be used to delimit columns for the -t option.

-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.

-x      Fill columns before filling rows.

eg:

#mount | column -t |sort  

//192.168.3.33/test               on  /mnt                      type  cifs         (rw,mand)
/data/redhat/images/diskboot.img  on  /data/redhat/images/test  type  vfat         (rw,loop=/dev/loop0)
devpts                            on  /dev/pts                  type  devpts       (rw,gid=5,mode=620)
/dev/sda1                         on  /boot                     type  ext3         (rw)
/dev/sda2                         on  /opt                      type  ext3         (rw)
/dev/sda3                         on  /var                      type  ext3         (rw)
/dev/sda5                         on  /usr                      type  ext3         (rw)
/dev/sda6                         on  /home                     type  ext3         (rw)
/dev/sda7                         on  /                         type  ext3         (rw)
/dev/sda9                         on  /data                     type  ext3         (rw)
/home/pupai/test                  on  /test                     type  none         (rw,bind)
none                              on  /proc/sys/fs/binfmt_misc  type  binfmt_misc  (rw)
proc                              on  /proc                     type  proc         (rw)
sysfs                             on  /sys                      type  sysfs        (rw)
tmpfs                             on  /dev/shm                  type  tmpfs        (rw)

原创粉丝点击