Zip specific files...
Hello All
I have some script files in a folder along with many other types of files. Is there a way to zip files by username or by permission of files. I want to zip all script files (with execution bit) in a directory. Thanks |
Hi
You could combine it with find it with the find command. Something like this: Code:
zip test.zip $(find . -type f -executable) |
Hi,
You can also use a pipeline: Code:
find -type f -executable | xargs zip foo.zip |
Thanks. For some reason -f executable didn't list all files with execution bit. The following worked for me.
Code:
zip scripts.zip $(find . -type f -perm /+x) |
zip creates test.zip archive if it doesn't exist and adds new members to it if it already exists, so this should also work:
Code:
find . \! -name '*~' -type f -executable -exec zip ../test.zip {} + |
Quote:
|
Quote:
Code:
$ ll |
How interesting. What would this command show:
Code:
find -type f -perm /+x -exec file {} \; |
re: #7
from manpage of find: Code:
-executable |
Quote:
My bad. Sorry. |
All times are GMT -5. The time now is 10:13 PM. |