Column formatting

Here is a quick tip on how to make the output of some tools prettier, for example we can use the mount command which by default looks like this

/dev/sda1 on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
none on /dev type devtmpfs (rw,mode=0755)

Using the column command with the -t option we can apply some formatting so it is more readable:

$ mount | column -t

/dev/sda1  on  /                         type  ext4        (rw,errors=remount-ro)
proc       on  /proc                     type  proc        (rw,noexec,nosuid,nodev)
none       on  /sys                      type  sysfs       (rw,noexec,nosuid,nodev)
none       on  /sys/fs/fuse/connections  type  fusectl     (rw)
none       on  /sys/kernel/debug         type  debugfs     (rw)
none       on  /sys/kernel/security      type  securityfs  (rw)
none       on  /dev                      type  devtmpfs    (rw,mode=0755)
Advertisements

, ,

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: