Created
July 25, 2014 15:50
-
-
Save Nicolab/2f3fe0a939c009466fbe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function traverse() { | |
find $1 -mindepth 1 -maxdepth 1 ! -type d -exec echo "$2"{} \; | |
for d in $(find $1 -mindepth 1 -maxdepth 1 -type d ! -name ".") | |
do | |
# if you just need files comment out next line | |
echo "$2$d" | |
traverse "$d" "${2} " | |
done | |
} | |
traverse $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output