Making archive from files with same names in different directories

Posted by Tim on Stack Overflow See other posts from Stack Overflow or by Tim
Published on 2010-04-23T11:15:27Z Indexed on 2010/04/23 11:23 UTC
Read the original article Hit count: 250

Filed under:
|

Hi,

I have some files with same names but under different directories. For example, path1/filea, path1/fileb, path2/filea, path2/fileb,....

What is the best way to make the files into an archive? Under these directories, there are other files that I don't want to make into the archive. Off the top of my head, I think of using Bash, probably ar, tar and other commands, but am not sure how exactly to do it.

Renaming the files seems to make the file names a little complicated. I tend to keep the directory structure inside the archive. Or I might be wrong. Other ideas are welcome!

Thanks and regards!

© Stack Overflow or respective owner

Related posts about bash

Related posts about archive