Skip to content

Instantly share code, notes, and snippets.

@themegabyte
Created October 5, 2017 07:57
Show Gist options
  • Save themegabyte/a44ba5f83af48b53aa7388d0f4517f43 to your computer and use it in GitHub Desktop.
Save themegabyte/a44ba5f83af48b53aa7388d0f4517f43 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo -e 'Cleaning up directory'
VAR=`ls -l *.mkv 2>/dev/null | wc -l | tr -d '\n'`
echo "removing $VAR .mkv file(s)"
if [ $VAR ]
then
rm -rf *.mkv
fi
VAR=`ls -l *.mp4 2>/dev/null | wc -l | tr -d '\n'`
echo "removing $VAR .mp4 file(s)"
if [ $VAR ]
then
rm -rf *.mp4
fi
VAR=`ls -l *.webm 2>/dev/null | wc -l | tr -d '\n'`
echo "removing $VAR .webm file(s)"
if [ $VAR ]
then
rm -rf *.webm
fi
VAR=`ls -l *.part 2>/dev/null | wc -l | tr -d '\n'`
echo "removing $VAR incompleted download file(s)"
if [ $VAR ]
then
rm -rf *.part
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment