create list of all files in every subdirectories in bash
There is also a program called tree, but you can simulate it with only shell builtins:
#!/bin/shDIR=${1:-`pwd`}SPACING=${2:-|}cd $DIRfor x in * ; do [ -d "$DIR/$x" ] && echo "$SPACING\`-{$x" && $0 "$DIR/$x" "$SPACING " || \ echo "$SPACING $x : MD5=" && md5sum "$DIR/$x"done
Note it requires a full path argument (or none for current directory)
Its not as fast as find (though there are plenty of ways to speed it up that make the code more complicated to follow), but gives a graphical representation of the tree structure.You can modify it to not follow symlinks by adding- && [ ! -L "$DIR/$x" ]
or to only list directories: remove the || echo $SPACING $x