Skip to content

Instantly share code, notes, and snippets.

@JCJAT
Last active April 12, 2017 15:11
Show Gist options
  • Save JCJAT/5e629d256cf8113e960cde438bf5ac04 to your computer and use it in GitHub Desktop.
Save JCJAT/5e629d256cf8113e960cde438bf5ac04 to your computer and use it in GitHub Desktop.
List all files and folders single file/folder per line linux
ls -Ra /path | 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