Skip to content

Instantly share code, notes, and snippets.

@kaskichandrakant
Created May 24, 2019 04:00
Show Gist options
  • Save kaskichandrakant/acdb44fae11e656df70e7d156d72423a to your computer and use it in GitHub Desktop.
Save kaskichandrakant/acdb44fae11e656df70e7d156d72423a to your computer and use it in GitHub Desktop.
#!/bin/bash
watch() {
echo watching folder $1/ every $2 secs.
while [[ true ]]
do
files=`find $1 -type f -mtime -$2s`
if [[ $files != "" ]] ; then
echo changed, $files
fi
sleep $2
done
}
watch dir_name 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment