Skip to content

Instantly share code, notes, and snippets.

@drnic
Created April 8, 2015 04:38
Show Gist options
  • Select an option

  • Save drnic/58cade960afb0b009010 to your computer and use it in GitHub Desktop.

Select an option

Save drnic/58cade960afb0b009010 to your computer and use it in GitHub Desktop.
Little script to pretty-print files in a tree from http://stackoverflow.com/a/1767559/36170
#!/bin/bash
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