I have the following four files in the file system:
/home/martin/cvs/ops/cisco/b/s1
/home/martin/cvs/ops/cisco/b/s2
/home/martin/cvs/ops/extreme/b/r3
/home/martin/cvs/ops/j/b/r5
I need to put those files into a tar archive, but I don't want to add directories. The best I could come up with was:
tar -C ~/cvs/ops/ -czvf archive.tgz cisco/b/s1 cisco/b/s2 extreme/b/r3 j/b/r5
This is still not perfect, because each file in the archive is two directories deep. Is there a better way? Or do I simply have to copy s1
, s2
, r3
and r5
files into one directory and create the archive with tar -czvf archive.tgz s1 s2 r3 r5
?