Old-Man-Programmer / tree

Tree for Unix/LInux
GNU General Public License v2.0
140 stars 31 forks source link

Feature Request: for MD5 Support #8

Open jerrin92 opened 2 months ago

jerrin92 commented 2 months ago

Could you add support for md5 sums of files?

$ tree . -L 1 --md5
.
|── basic_typer.py (82f113cdddcbb92cc176acf64df0ad4e)
|── typer_env (Is a directory)
|── typer_exit.py (08a127d9c289eda5e0ffbf6bb8ebbe07)
└── typer_exit_usernames.yaml (ecdb6d9440a961748f594933784968df)
Old-Man-Programmer commented 2 months ago

This seems a bit too obscure a use case. You can get most of what you want I think with find / awk and the --fromfile option:

find -type f -a -exec md5sum {} \; | awk '{print $2 " (" $1 ")"}' | tree --fromfile

This does omit directories with nothing in them however.

jerrin92 commented 1 month ago

Cool! works like a charm! 😄

polluks commented 1 month ago

This works for macOS: find . -type f -a -exec md5sum {} \; | awk '{print $2 " (" $1 ")"}' | tree --fromfile