If all the files are at the same tree depth (I mean, they all are in the same number of directories), you can use gtar with the --strip-path or --strip-components modifier.
Let's assume, your files pathnames are like these:
you can do
and then you get all six files in the current directory.
If the tree depth is variable, I am not aware of any tar option you could use to extract the files the way you want.
hi everyone
i have a tar file which was in AIX box. its 300mb.
i cant untar in windowsxp home. I just get an empty folder with no files when i extract. i dont get any bad header or any such error.
i am using IZARC which is a freeware. Not sure if i should try winzip or winrar.
any help (2 Replies)
I received a tar file of a directory with 50,000 files in it. Is it possible to extract the files in the tar file without first creating the directory?
ie. Doing tar -xvf filename.tar extracts as follows:
x directory/file1.txt
x directory/file2.txt
.
.
.
I would like to avoid... (4 Replies)
Hi
I have done a search for this but couldn't find much on it.
I am creating a tar file with the command below
tar cvf /export/home/user/backup/*Will this is being created I have a job spooling to 5 texts files in the following directory /export/home/user/backup/STATS/
The tar files... (1 Reply)
I am trying to archive directories based on their last modified date. When I tar and compress the directory it makes copies of whats inside, I don't know how to fix this.
Here is my code.
#!/bin/bash
#AUTODRUNDISABLE
VERSION="0.2"
cd /desired/directory/to/archive
find . -type d -newermt... (3 Replies)
I would like to confirm my file.tar is been tar-ed correctly before I remove them. But I have very limited disc space to untar it.
Can I just do the listing instead of actual extract it? Can I say confirm folder integrity if the listing is sucessful without problem?
tar tvf file1.tar
... (1 Reply)
how can i move "dataName".sql.gz into a folder called 'database' and then move "$fileName".tar.gz * .htaccess into a folder called 'www' with the entire gzipped file being "$fileName".tar.gz? Is this doable or overly complex.
so
mydemo--2015-03-23-1500.tar.gz
> database
-... (5 Replies)
#cat a
BAC064DAL
BAC063DAL
BAC056PHX
BAC066DAL
BAC062PHX
BAC062DAL
BAC060DAL
BAC058PHX
BAC054PHX
BAC051PHX
# for i in `cat a`
> do
> tar xvf $a/$a*.tar*
> done
tar: /*.tar*: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
tar: /*.tar*: Cannot... (3 Replies)
i extract it through script, is there any way to script or automate to tar extract a tarfiles in multiple directories at once?
Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
for dir in `ls -d /tarfiles/*/ | sed 's/.$//'`
do
rm -f $dir/*.tar
mv -f... (1 Reply)
Hi all. I'm hitting a problem creating a tar archive in one directory from files located in a different directory. It fails when I replace the absolute paths with variables in the script but works if I just run tar on the cmdln. E.g.
#!/bin/ksh
BASE=$PWD
STAGE=$BASE/stage
LOG=$BASE/log... (4 Replies)
Discussion started by: user052009
4 Replies
LEARN ABOUT DEBIAN
arch::tarball
Arch::Tarball(3pm) User Contributed Perl Documentation Arch::Tarball(3pm)NAME
Arch::Tarball - an interface to create and work with tarballs
SYNOPSIS
use Arch::Tarball
my $tarball = Arch::Tarball->new;
my $pipe = $tarball->create(
dir => '/path/to/subdir-to-pack',
base_name => 'new-subdir-to-pack',
pipe => 1,
);
DESCRIPTION
Arch::Tarball provides an object oriented interface to work with (create, examine or extract) standard gzipped tarballs.
Note: As functionality is added only when needed, a lot of features are currently not implemented.
METHODS
The following functions are available:
new, create, extract, list.
new %opts
Creates a new Arch::Tarball object.
The following parameters can be set via %opts:
tar The name of the tar executable. Defaults to "tar".
file
The filename of the Tarball.
create %opts
Creates a new tarball (tar.gz) from a given directory structure.
create understands the following options:
dir (mandatory)
Specifies the base directory for the tarball. The given directory and recursively its content will be added to the tarball. The
directory's basename will be used as the first and the only subdirectory in the tarball.
base_name
Allow the programmer to specify a different base directory name for the tarball content than the basename of dir. In this case,
'cp' process is launched to temporarily rename the last element of dir.
pipe
When set, create does not create a physical tarball but writes the tarballs content to a newly created pipe. The pipe is returned
by the create method.
Note: Currently the pipe option is mandatory.
extract %opts
Extracts the tarball to a given target directory, specified by dir option. If dir option is not given, a temporary directory is
created that will hold the extracted dirs/files. This directory is returned.
The file option specifies the tarball file name. It may be given in the constructor instead.
list %opts (not implemented yet)
Returns a list of files and directories in the tarball.
BUGS
Most functionality is currently not implemented. If you need part of the missing functionality, please contact the authors.
Patches are greatly appreciated.
AUTHORS
Mikhael Goikhman (migo@homemail.com--Perl-GPL/arch-perl--devel).
Enno Cramer (uebergeek@web.de--2003/arch-perl--devel).
perl v5.10.1 2005-04-22 Arch::Tarball(3pm)