1

How do I create a password protected archive containing all the files with the extension conf from /etc?

2 Answers 2

1

Given that the question was tagged with zip, you're probably looking for something like this:

$ ls /etc/*.conf | xargs zip myfile.zip -e
1
  • Depending on the permissions of the files added to the zip file, you might need to execute as root.
    – jcollado
    Nov 10, 2011 at 17:23
1

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .