Skip to main content

Posts

Showing posts with the label gunzip

Playing with Tar and gz commands

I was amused by Unix utilities. They are very powerful, but they are tricky for use. Let me note down some of them as they come along. #To tar up *.log in the current directory into a tarball called abc.tar.gz, issue this command: tar cfz abc.tar.gz *.log #untar tar xvf something.tar #To see a list of the files within a tarball, issue the following command: # Helpful as its without untarring the file tar -tzf blah.tar.gz # gunzip -c $file | tar xf -     #AIX # Series of files while read file; do gunzip -c $file | tar xf - done < filelist #If you only want certain directories from the tarball, do this: tar xvzf something.tar.gz */dir.you.want/*