Created
April 5, 2017 10:34
-
-
Save Sam-R/04087ffe8e73a7eb63b1cc426ceb55db to your computer and use it in GitHub Desktop.
Find files with the same name but different extensions in a directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Find duplicate filenames | |
## Find everything in the Pictures directory with the same file name excluding extension. | |
ls -1 ~/Pictures/ | sed 's/\(.*\)\..*/\1/' | sort | uniq -c | grep -v " 1 " | |
# Find unique filenames | |
## Find everything in the Pictures directory without the same file name excluding extension. | |
ls -1 ~/Pictures/ | sed 's/\(.*\)\..*/\1/' | sort | uniq -c | grep -v " 2 " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment