Search for files w/extension, then zip them to a different directory?
Hi, basically I'm trying to find files with a certain extension in a directory (this part works fine), and then zip those files to a different location.
This works fine for zipping them to the location they are found in: Code:
find ../somedirectory -type f -name "*.txt" -exec zip "$(basename {})"zip {} \; Code:
find ../somedirectory -type f -name "*.txt" -exec zip "/someotherdirectory/$(basename {})"zip {} \; Code:
zip I/O error: No such file or directory |
The command substitution seems to be not getting the {} placeholder filled in time. Try it in a shell:
Code:
find ../somedirectory -type f -name "*.txt" \ |
puts it all into one zip file
Code:
find path -type f -name "*.txt" -print | zip path/nameOfFile.zip -@ |
Quote:
|
All times are GMT -5. The time now is 07:24 AM. |