How do I create a password protected archive containing all the files with the extension conf from /etc
?
2 Answers
Given that the question was tagged with zip
, you're probably looking for something like this:
$ ls /etc/*.conf | xargs zip myfile.zip -e
-
Depending on the permissions of the files added to the zip file, you might need to execute as root.– jcolladoNov 10, 2011 at 17:23
Considering a very unlikely scenario when *.conf
filenames in /etc
contain spaces, this is a safe way to zip them:
find /etc -name *.conf -print0 | xargs -0 zip archive.zip -e