I'm running Mac OSX and trying to use the command line to find the number of files I have with the same name.
I tried to use the following command:
find ~ -type f -name "*" -print | basename | sort | uniq -d > duplicate_files
It doesn't work! When I do the following:
find ~ -type f -name "*" -print > duplicate_files
Then duplicate_files does contain the paths of all my files. So I think the issue is with
basename - it doesn't accept standard input. I then tried the following:
basename $(find ~ -type f -name "*" -print) > duplicate_files
but again that doesn't seem to work. Search on the internet doesn't seem to yield much joy. Any thoughts most welcome.