# HG changeset patch # User František Kučera # Date 1547766058 -3600 # Node ID 2adb6465eaddcffbfb93bb4dceb4de95a235bf89 # Parent d29970e8b7c9405b186a7c7a2fe27d9d41050d2c examples: relpipe-in-filesystem diff -r d29970e8b7c9 -r 2adb6465eadd relpipe-data/examples.xml --- a/relpipe-data/examples.xml Fri Jan 18 00:00:20 2019 +0100 +++ b/relpipe-data/examples.xml Fri Jan 18 00:00:58 2019 +0100 @@ -697,6 +697,113 @@ as will be shown in further examples.

+

Read files metadata using relpipe-in-filesystem

+ +

+ Our filesystems contain valuable information and using proper tools we can extract them. + Using relpipe-in-filesystem we can gather metadata of our files and process them in relational way. + This tools does not traverse our filesystem (remember the rule: do one thing and do it well), + instead, it eats list of file paths separated from standard input. + It is typically used together with the find command, but we can also create such list by hand using e.g. printf command. +

+ + find /etc/ssh/ -print0 | relpipe-in-filesystem | relpipe-out-tabular + +

+ In the basic scenario, it behaves like ls -l, just more modular and machine-readable: +

+ +
+ +

+ We can specify desired attributes and also their aliases: +

+ + + +

And we will get a subset with renamed attributes:

+ +
+ +

+ We can also choose, which path format fits our needs best: +

+ + + + +

The path attribute contains the exact same value as was on input. Other formats are derived:

+ +
+ +

+ We can also select symlink targets or their types. + If some file is missing or is inaccessible due to permissions, only path is printed for it. +

+ +

+ Tip: if we are looking for files in the current directory and want omit the „.“ we just call: find -printf '%P\0' instead of find -print0. +

+