Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Tar up key files by extension?
Name: hippiejoeland (by HippieJoeLand) Date: April 18, 2007 at 18:07:52 Pacific OS: OS X/*nix CPU/Ram: average Product: 1-2GB
Comment:
I would like to recursively troll through my OS X and or nix systems, find files of importance based on file extension, and put them in a compressed tar. The problem I am having is getting Tar to accept the standard input from the prior commands. Here is what I have so far using .doc just as an example:
find / -type f -print | grep -iE '\.doc$' | tar -czvf test.tar.gz
Something like that is my goal...
Currently I am writing all results fromthe find/grep to a text file, then using the Include-files switch with Tar to tar them up via and && which just isn't as pleasing. Any ideas?
HippieJoe
PS. I tried using cpio with format tar then pushing it to gzip...i kept getting archive truncated errors.
find . -name '*.java' | tar czvf a.tar.gz --files-from -
0
Response Number 3
Name: hippiejoeland (by HippieJoeLand) Date: May 24, 2007 at 13:39:41 Pacific
Reply:
Guy,
Thanks a ton!! I never could get that standard out switch in the right place...I was using a two liner like your first suggestion. I like this much better!
The solution to find all files, tar and gzip them when the file ENDS in a .txt (thanks to Guy):
find . -mount -depth -type f -print | grep -iE '*\.txt$' | tar -czvf ../test.tar.gz -T -
Summary: How do you clean up temp files in Linux? I have an Internet-Appliance (went out of business) Internet Pro e-mail /Fire wall server running Linux and one of the partions are full & I need to clean it ...
Summary: If I am using the ect3 filesystem, wil linux screw up mac files? I know windows will strip the file of the resource fork, but dose linux do that? ...
Summary: try typing it out and using the TAB key to complete the file BASH should bring up the file. If tar fails then I am thing you download ed in ASCII. ...