how to tar a folder with specific subfolders

jsn

Registered
Hi all.

Is there a way to tar a folder that will contain only some specific subfolders.

Here is my case:

in the folder /main/smain/ I have severa subfolders sb1, sb2, sb3

I need only to to tar subfolders sb1 and sb3 but starting from /main

is there a way to do it?
thanks
jose
 
Code:
(cd /main; tar -cvpf /tmp/foo.tar smain/sb1 smain/sb3)

Or, if you're already in /main

Code:
tar -cvpf /tmp/foo.tar smain/sb1 smain/sb3

Brian
 
Back
Top