![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Adding Multiple Lines to Multiple Files | dayinthelife | Shell Programming and Scripting | 2 | 06-04-2008 08:50 AM |
| Splitting input files into multiple files through AWK command | arund_01 | Shell Programming and Scripting | 3 | 05-13-2008 06:17 AM |
| Multiple search in multiple files | maxvirrozeito | Shell Programming and Scripting | 2 | 12-13-2007 10:32 AM |
| when I try to run rm on multiple files I have problem to delete files with space | umen | UNIX for Dummies Questions & Answers | 1 | 09-20-2005 12:20 AM |
| Searching multiple files with multiple expressions | Anahka | Shell Programming and Scripting | 6 | 01-07-2004 03:24 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Tar multiple files
Hi All,
There 2 files in the folder /temp/tst/ 1.txt 2.txt When I run the command find /temp/tst \( -name "*.txt" \) -exec tar cf /temp/123.tar {} \; it creates the tar file 123.tar with only one file in it and that is 2.txt.But if I use the command find /temp/tst \( -name "*.txt" \) -exec tar cf /temp/123.tar {} + 1>/dev/null it creates both the files in the 123.tar file which is what I want. But I don't understand why is this happening. Any comments experts? Last edited by rony_daniel; 10-02-2006 at 05:31 PM. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
The + tells find to only run it once. It runs it like "tar -cf file.tar file1 file2", which includes both files in one archive, file.tar.
The version without the + runs tar twice, once for each file. tar does not automatically append, it replaces, so it replaces the first archive. |
|||
| Google The UNIX and Linux Forums |