Skip to content

Instantly share code, notes, and snippets.

@tolgahanakgun
Last active March 10, 2025 20:09
Show Gist options
  • Save tolgahanakgun/3482fddf75f30c4c8fcda5edf16c7a8c to your computer and use it in GitHub Desktop.
Save tolgahanakgun/3482fddf75f30c4c8fcda5edf16c7a8c to your computer and use it in GitHub Desktop.
Shell Notes

Foreach file in a directory loop

for file in $( find /path/to/dir -maxdepth 1 -type f -name "*.mp4" | sort ); do
    echo "$file"
done

Find duplicate files in a directory

find . ! -empty -type f -exec md5sum {} + | sort | uniq -w32 -dD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment