Skip to content

Instantly share code, notes, and snippets.

@junquera
Created February 15, 2016 22:14
Show Gist options
  • Select an option

  • Save junquera/0f1716d798db6b283f0c to your computer and use it in GitHub Desktop.

Select an option

Save junquera/0f1716d798db6b283f0c to your computer and use it in GitHub Desktop.
List and show all files and folders in a directory
for i in $(find .);
do
if [ -d $i ];
then
echo "Dir $i"
else
echo "File $i" && cat "$i"
fi
done
for i in $(ls -d1 $(find .));
do
if [ -d $i ];
then
echo "Dir $i"
else
echo "File $i" && cat "$i"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment