LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-11-2010, 01:47 AM   #1
saran_redhat
Member
 
Registered: May 2009
Location: chennai
Posts: 247

Rep: Reputation: 16
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
 
Old 02-11-2010, 02:01 AM   #2
sohail0399
Member
 
Registered: Oct 2008
Location: Pakistan, Islamabad
Distribution: CentOS, Fedora, Solaris
Posts: 154

Rep: Reputation: 23
one simple solution is :

move or copy *.txt and *.jpg files to another directory and make of that.
 
Old 02-11-2010, 05:45 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
tar zcvf backup.tgz *.html *.jpeg

Untested(!)
 
Old 02-11-2010, 06:54 PM   #4
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Quote:
Originally Posted by chrism01 View Post
tar zcvf backup.tgz *.html *.jpeg

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


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
compress folder in rar infonlinebr Linux - Newbie 5 03-17-2016 02:08 PM
how to compress ~130GB folder and erase original files at the same time arshadul Linux - Newbie 3 04-20-2009 06:48 PM
Compress folder to Zip file makan007 Red Hat 1 09-05-2006 04:27 AM
to compress a file or folder sanjay2004 Linux - Newbie 1 04-11-2006 08:28 AM
How to compress a folder deWin Linux - Newbie 3 11-11-2004 10:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration