Rafael Nalin
Rafael Nalin

Reputation: 51

Creating a tar.gz file with files that starts with C, in subdirectories

I have 1280 folders (Their names are 1, 2, 3, ..., 1280). Inside each folder I have several .txt files. However, I would like to create a single tar.gz file just for the .txt files that start with the letter "C".

Is it possible to do it? Any help would be great! Thank you in advance

Upvotes: 0

Views: 643

Answers (1)

Cyrus
Cyrus

Reputation: 88776

With bash and tar:

tar -cvzf your.tar.gz */C*.txt

Upvotes: 2

Related Questions