I know this is a common error but I'm really stuck and could use some help.
I need to create an Excel sheet of any files in a subdirectory named Parent, that exists in the root folder Tabletop. This is what I have:
find $(find /Volumes/COMMON-LIC-PHOTO/STUDIO-COMPLETE/ARCHIVE/Tabletop -type d -iname parent | xargs) -type f > Parent_Files_TT.csv It searches for folders named Parent and then copies the full file path to Excel. This has worked on other smaller folders I have, but Tabletop has hundreds of thousands of files in it and I get the error:
/usr/bin/find: Argument list too long
I have tried to modify this to use xargs when finding the file:
find $(find /Volumes/COMMON-LIC-PHOTO/STUDIO-COMPLETE/ARCHIVE/Tabletop -type d -iname parent | xargs) -type f -print0 | xargs > Parent_Files_TT.csv And have also tried "*":
find $(find /Volumes/COMMON-LIC-PHOTO/STUDIO-COMPLETE/ARCHIVE/Tabletop -type d -iname parent | xargs) -type f -name "*" > Parent_Files_TT.csv But I'm getting the same error. If someone can help me modify this I'd be really grateful.
xargs -0withfind ... -print0?find $(...)part is the problem here. You're interpolating a massive thing. Try restructuring this to pipe the result of the first find into the second somehow.