LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Compress one Folder (https://www.linuxquestions.org/questions/linux-newbie-8/compress-one-folder-788388/)

saran_redhat 02-11-2010 01:47 AM

Compress one Folder
 
Hai Friends

I have one doubt. I have one folder in my linux server. that folder having lot of sub folder , text files , images etc...
I need to tar that file using tar command . my need is i dont want tar for that full folder. i want to tar only html and txt files only .
so how to do this

please advise me

i am using centos 5

sohail0399 02-11-2010 02:01 AM

one simple solution is :

move or copy *.txt and *.jpg files to another directory and make of that.

chrism01 02-11-2010 05:45 PM

tar zcvf backup.tgz *.html *.jpeg

Untested(!)

MTK358 02-11-2010 06:54 PM

Quote:

Originally Posted by chrism01 (Post 3860835)
tar zcvf backup.tgz *.html *.jpeg

Untested(!)

That won't go recursively into subfolders, and also it will spill into many files when extracted.


All times are GMT -5. The time now is 01:36 AM.