Skip to content

Instantly share code, notes, and snippets.

@invalidusrname
Last active December 18, 2015 17:10
Show Gist options
  • Save invalidusrname/5817004 to your computer and use it in GitHub Desktop.
Save invalidusrname/5817004 to your computer and use it in GitHub Desktop.
for app in /var/apps/*
do
dir=$app/releases
if [ -d $dir ]
then
release_count=$(ls -l $dir | sed 1d | wc -l )
echo "$release_count - $dir"
if [ $release_count -gt 2 ]
then
ls -lth $dir | awk '{print $9}' | sed 1d | sort
fi
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment