Skip to content

Instantly share code, notes, and snippets.

@lewdlime
Created July 26, 2015 16:24
Show Gist options
  • Save lewdlime/e2ec326302be172c3f42 to your computer and use it in GitHub Desktop.
Save lewdlime/e2ec326302be172c3f42 to your computer and use it in GitHub Desktop.
#!/bin/bash
# list directories recursively, with pretty-printing. Prints one item per line.
ls -R $1 | awk '
/:$/&&f{s=$0;f=0}
/:$/&&!f{sub(/:$/,"");s=$0;f=1;next}
NF&&f{ print s"/"$0 }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment