Compress the file using Tar command


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Compress the file using Tar command
# 1  
Old 12-17-2009
Compress the file using Tar command

Hi,
When i am tar the file particular ,csv file format in a folder i am receiving the error
Command:
Code:
tar cf  New_data.tar  /new/file/mari/getdata/small/*.xml
Arguements too long


But sometimes
i am able to compress other folder but the tar folder contains all the file format and folder
Command:
Code:
tar cf New_data.tar /new/file/see/New/small/*.xml

New_data.tar contains the file listed below
1)backup
2)newfiles and also xml file
like these are present

Last edited by pludi; 12-17-2009 at 06:27 AM.. Reason: code tags, please...
# 2  
Old 12-17-2009
And your question would be....?
# 3  
Old 12-17-2009
I think the problem is related to the big number of xml files inside that directory,
# 4  
Old 12-17-2009
Plz Provide the Solution

Hi ironmask2004
you are correct .What can i do for that ?Plz reply me
# 5  
Old 12-17-2009
Well then, why didn't you say so? How can we know what answer you're looking for if you don't ask?

You can try adding the files in chunks, eg:
Code:
# Warning: untested!
find /new/file/mari/getdata/small/ -type f -name '*.xml' -print | xargs tar -rf New_data.tar

# 6  
Old 12-18-2009
Thanks Pludi

But i am receiving the error:tar cannot open New_data.tar
# 7  
Old 12-18-2009
If you don't mind working in 2 steps:
Code:
tar -cf New_data.tar /new/file/mari/getdata/small/a*.xml
find /new/file/mari/getdata/small/ -type f -name '*.xml' -print | xargs tar -uf New_data.tar

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

UNIX command to check if file name ends with .tar OR if the file is a tar file

Hello Team, Would you please help me with a UNIX command that would check if file is a tar file. if we dont have that , can you help me with UNIX command that would check if file ends with .tar Thanks in advance. (10 Replies)
Discussion started by: sanjaydubey2006
10 Replies

2. Red Hat

Command to compress a file

Hi, When we want to compress a file which is of huge size then what command is best for us.Kindly suggest on this. 1.Tar command or 2.gzip command OS -- Linux 2.6 Regards, Maddy (6 Replies)
Discussion started by: Maddy123
6 Replies

3. Shell Programming and Scripting

Compress a tar file to smaller size

I have a tar file with name DTT012_GP_20140207.tar and many more with different names of different sizes ranging from 1GB to 4GB. Now my requirement is to extract/not extract these files and then divide it into various parts of size 500MB and save it with different names and then compress... (5 Replies)
Discussion started by: Shaibal_bp
5 Replies

4. UNIX for Dummies Questions & Answers

Compress 1st 20 Large different File using tar

Sorry guys.. dont know where to put this.. currently I am cleaning up system dump on our aix machine and I wanted to set zero the 1st 20 large file but before doing that I wanted to create some backup. is there any command that can compress all these file same time? tar syntax file? ... (2 Replies)
Discussion started by: thermometer
2 Replies

5. Shell Programming and Scripting

identify files with "Normal termination" and compress them into a .tar.gz file

Hi, I have hundreds of files "*.out" located in one folder, and I want to: 1. Identify the good files containing "Normal termination" (grep "Normal termination" *.out ) 2. Compress the good files into a tar.gz file (tar cvfz good.tar.gz *.goog.out ) Is there a way I can automate this... (4 Replies)
Discussion started by: rockytodd
4 Replies

6. Shell Programming and Scripting

tar and compress in one step

I know there is a way to tar up directory and sub-directories and have it compressed all in one command but but the syntax escapes me. I seem to re-call something like this: tar -cvf /tmp/file.tar - | compress ? Can somebody please provide me with the syntax on how to tar/compress and... (6 Replies)
Discussion started by: BeefStu
6 Replies

7. UNIX for Advanced & Expert Users

UNIX: Command to compress folder and all files into a tar

I am trying to grab a folder and all the folders and files underneath it and send it from one computer to another. I basically want to compress the whole folder into a tar, tgz, or zip file so that it can be sent as one file. is there a command to compress a folder and all its contents into a tar... (7 Replies)
Discussion started by: kane4355
7 Replies

8. UNIX Desktop Questions & Answers

file zip,rar,tar,compress,uncompress,unzip,unrar

i want know how to compress and uncompress file using unix, compress uncompress,zip,unzip,rar,unrar,how its work and more about this.:confused: (1 Reply)
Discussion started by: ismael xavier
1 Replies

9. UNIX for Advanced & Expert Users

tar and compress

I need to compress and tar a couple files in a directory, but I also want the original files unchanged, ie if I compress a1.cpp , then a1.cpp becomes a1.cpp.z, but what I want after running the compress utility is to have both a1.cpp as it is and a1.cpp.z and then tar a1.cpp.z to an... (4 Replies)
Discussion started by: muru
4 Replies

10. UNIX for Dummies Questions & Answers

tar command with compress option...

Hi ! i have to write a script that archivs homes not used since 3 years. First, my script gathers the users that are concerned, using the following command : ll -lt /home/*/.sh_history | egrep '2000|1999|1998|1997' | awk '{print $3}' i obtain a list like this : user_1 user_2 ...... (3 Replies)
Discussion started by: tomapam
3 Replies
Login or Register to Ask a Question