Using command relpipe-in-fstab
we can convert the /etc/fstab
or /etc/mtab
to relational data
relpipe-in-fstab | relpipe-out-tabular
and see them as a nice table:
fstab: ╭─────────────────┬──────────────────────────────────────┬──────────────────────┬───────────────┬───────────────────────────────────────┬────────────────┬────────────────╮ │ scheme (string) │ device (string) │ mount_point (string) │ type (string) │ options (string) │ dump (integer) │ pass (integer) │ ├─────────────────┼──────────────────────────────────────┼──────────────────────┼───────────────┼───────────────────────────────────────┼────────────────┼────────────────┤ │ UUID │ 29758270-fd25-4a6c-a7bb-9a18302816af │ / │ ext4 │ relatime,user_xattr,errors=remount-ro │ 0 │ 1 │ │ │ /dev/sr0 │ /media/cdrom0 │ udf,iso9660 │ user,noauto │ 0 │ 0 │ │ │ /dev/sde │ /mnt/data │ ext4 │ relatime,user_xattr,errors=remount-ro │ 0 │ 2 │ │ UUID │ a2b5f230-a795-4f6f-a39b-9b57686c86d5 │ /home │ btrfs │ relatime │ 0 │ 2 │ │ │ /dev/mapper/sdf_crypt │ /mnt/private │ xfs │ relatime │ 0 │ 2 │ ╰─────────────────┴──────────────────────────────────────┴──────────────────────┴───────────────┴───────────────────────────────────────┴────────────────┴────────────────╯ Record count: 5
And we can do the same also with a remote fstab
or mtab
; just by adding ssh
to the pipeline:
ssh example.com cat /etc/mtab | relpipe-in-fstab | relpipe-out-tabular
The cat
runs remotely. The relpipe-in-fstab
and relpipe-out-tabular
run on our machine.
n.b. the relpipe-in-fstab
reads the /etc/fstab
if executed on TTY. Otherwise, it reads the STDIN.
Relational pipes, open standard and free software © 2018-2022 GlobalCode