Sample Header Ad - 728x90

Creating .info files to be used with tree

4 votes
2 answers
1043 views
man tree1 states: > -info Prints file comments found in .info files. See .INFO FILES below for more information on the format of .info files. and further >**.INFO FILES** > >.info files are similiar to .gitignore files, if a .info file is found while scanning a directory it is read and added to a stack of .info information. Each file is composed of comments (lines starting with hash marks (#),) or wild-card patterns which may match a file relative to the directory the .info file is found in. If a file should match a pattern, the tab indented comment that follows the pattern is used as the file comment. A comment is terminated by a non-tab indented line. Multiple patterns, each to a line, may share the same comment. # Objective Given the following directory structure: tree . ├── fileA.txt ├── fileB.txt └── other_files └── fileC.txt I would like to create a an info file(s) that would enable me to get the following output . ├── fileA.txt # Comments on file A read from info file ├── fileB.txt # Comments on file B read from info file └── other_files └── fileC.txt Following the man pages this should be possible but I can't find an example how such an info file should be created. I've identified [one potentially relevant discussion](https://unix.stackexchange.com/q/164443/159721)2 but it's not clear to me what should be the structure of this .info file so tree can use it to populate outputs with additional comments. --- 1Version: tree v2.0.2 (c) 1996 - 2022 by Steve Baker, Thomas Moore, Francesc Rocher, Florian Sesser, Kyosuke Tokoro* 2 As discussed in the comments, the link is not pertinent to this question.
Asked by Konrad (363 rep)
Mar 29, 2022, 02:50 PM
Last activity: Apr 18, 2024, 06:23 PM