Linux column命令详解(每日一令之二十一)
2013-12-20 17:42
281 查看
功能介绍:
格式化输出
使用放法:
我以为-s选项是输出分隔符,比如上面,我是用如下命令:
man column没有详细说明使用方法,info column也没有:
google发现他是输出分隔符,使用方法如下
本文出自 “从运维到ETL” 博客,请务必保留此出处http://fuwenchao.blog.51cto.com/6008712/1343330
格式化输出
使用放法:
NAME column - columnate lists SYNOPSIS column [-tx] [-c columns] [-s sep] [file ...] 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. The options are as follows: -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. Column exits 0 on success, >0 if an error occurred.实例
[root@uyhd000225 ~]# mount /dev/hda1 on / type ext3 (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/xvdb1 on /data type ext3 (rw) none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) [root@uyhd000225 ~]# mount |column -t /dev/hda1 on / type ext3 (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/xvdb1 on /data type ext3 (rw) none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)解释-s选项:
我以为-s选项是输出分隔符,比如上面,我是用如下命令:
[root@uyhd000225 ms]# mount |column -s '@' -t /dev/hda1 on / type ext3 (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/xvdb1 on /data type ext3 (rw) none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) [root@uyhd000225 ms]#我以为他会输出以@为分隔符,但是没有安装我的期望输出
man column没有详细说明使用方法,info column也没有:
google发现他是输出分隔符,使用方法如下
[root@uyhd000225 testDir]# cat testcolumn Jackie | 18 | male Helen | 20 | female Daniel Liu | 23 | male [root@uyhd000225 testDir]# cat testcolumn | column -s '|' -t Jackie 18 male Helen 20 female Daniel Liu 23 male
本文出自 “从运维到ETL” 博客,请务必保留此出处http://fuwenchao.blog.51cto.com/6008712/1343330
相关文章推荐
- Linux glibc被删除。。。。。。。
- 在Linux下使用命令行安装DB2
- Linux下xampp里面的proftpd简明使用方法
- Linux 安全之pam后门
- linux 后台执行命令
- suse10 linux下载地址
- Linux c动态链接库的生成及使用
- Linux基础知识之文件和目录的权限机制
- Linux命令行之逗趣无极限
- Linux常用命令——复制、删除、创建、压缩、解压
- Linux查看系统配置常用命令
- Linux下ACL权限管理
- linux 压缩与解压缩
- linux 3.5.4 系统调用分析
- 详解linux运维工程师入门级必备技能
- 在VMware中安装linux系统
- Linux c开发过程中常用命令(一)
- Linux下运行jar程序
- [Linux] 文件时间属性及touch命令
- linux进程间内存共享和信号量协作[基于哈工大操作系统实验]