1.

Solve : How do I compress and archive a file??

Answer»

How do I compress and archive my "yyyyfile" into an archive file "zzzzfile" in my HOME directory in one command? Quote from: ratrace on April 22, 2010, 07:04:46 PM

How do I compress and archive my "yyyyfile" into an archive file "zzzzfile" in my home directory in one command?

archive your whole directory
Code: [Select]tar zcfv mytarfile.tar.gz /homedir/

if you want to archive one file, just USE gzip, or zip
Code: [Select]gzip myfile
I have to perform the command specifically as stated in my question, it's for a class and it's due by midnight tonight and I only am stuck on a few things.

I'm getting an error:

$ tar zcfv yyyyfile.tar zzzzfile
tar: invalid option -z
Usage: tar c[vwfbB[[0-9][hlm]]] [pathname ...]
       tar r[vwfbB[[0-9][hlm]]] [files ...]
       tar t[vwfbB[[0-9][hlm]]
       tar u[vwfbB[[0-9][hlm]]] [pathname ...]
       tar x[vwfblmpB[[0-9][hlm]]] [pathname ...]

What should I try now? Thanks for your help--very appreciated!!!Would it be the following:

tar -xvf filename.tar newfilename ?

when I do that I get the following:
thisfile.tar in ustar format
0 files, 8 blocks

I don't know this stuff well enough to know what that means!what OS are you on? your tar don't have the -z option, so just tar it normally, then gzip it

Code: [Select]tar cvf mytarfile.tar myfile
gzip mytarfile.tar
XP--the direction say to do it in one step, but if it's not possible then I'll just paste the error msg with the command.

Thanks again! Quote from: ratrace on April 22, 2010, 08:45:22 PM
XP

Thanks again!
neither tar not gzip come by default with windows XP, and the shell prompt you've displayed is not a Windows Command Prompt... True. The OP would have to be using cygwin or another NIX emulation LAYER to have such a result. Cygwin uses an emulation layer to transform Unix system calls to those supported by Windows, so it is slower than the real thing. Rsync-ing to Windows filesystems also meant issues with file PERMISSIONS and owners


Discussion

No Comment Found