1

I want to take backup of selective files say *.py under a directory. How can i do that?

Please help me to achieve it.

4

Actually, you'd probably want something more like

tar cvf filename.tar `find . -name '*.py'`

The first example would only get *.py files one level deep.

| improve this answer | |
0

tar cf filename.tar *.py Should do what you need.

| improve this answer | |
0

In order to accommodate possible filenames with spaces and do a recursive search, use:

find . -type f -name '*.py' -print0 | tar --null cvf archive_name.tar -T -
| improve this answer | |
  • You probably want 'cvf' as the filename has to come as the argument to f – Kamil Kisiel Feb 17 '10 at 17:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy