The ~ expands to an absolute path. If your tar is not GNU tar, then the leading / is not stripped off. And a relocation during extraction is impossible.
I would use cd and let the shell expand the wildcards *.txt (without quotes. I think that tar handles wildcards (in quotes) only at extraction, anyway).
Now tar -tf test.tar shows the files without path. So you can extract at any location you want, using cd or the -C option.
This User Gave Thanks to MadeInGermany For This Post:
Hi,
ich just uploaded a file to the forum and found that the tar.gz extension for files is not allowed... i renamend the file to *.zip but tar.gz is a common format in the unix world. is it possible to change that?
tia,
DN2 (2 Replies)
hi guys..
Since am a bit new to shell scripting, can anyone help me with this problem please.. i've been struggling with it since 2 days. :(
I have a directory lets say myFolder and within it I have sub directories let say myFolder1.tar, myFolder2, myFolder3, etc. I need to write a shell... (12 Replies)
HI,
if I have a tarfile called pmapdata.tar that contains
tar -tvf pmapdata.tar
-rw-r--r-- 0/0 21 Oct 15 11:00 2009 /var/tmp/pmapdata/pmap4628.txt
-rw-r--r-- 0/0 21 Oct 14 20:00 2009 /var/tmp/pmapdata/pmap23752.txt
-rw-r--r-- 0/0 1625 Oct 13 20:00 2009... (1 Reply)
I've been able to find all the extensionless files named photos using the command:
find /usr/local/apache/htdocs -name photos -print0
I need to copy those files to the name photos.php in their same directory.
I've found a bunch of xarg examples for moving to other directories but I wasn't... (7 Replies)
I want to backup all the directory tress, including hidden directories, without copying any files.
find . -type d gives the perfect list.
When I tried tar, it won't work for me because it tars all the files.
find . -type d | xargs tar -cvf a.tar
So i tried rsync.
On my own test box, the... (4 Replies)
Hi all,
i have 2 directory of files, the first directory(ext1directory) contain files of extension .ext1 and the second directory(allextdirectory) contains files of multiple extensions (.ext1,.ext2,.ext3,..)
so i want to copy the files from directory 2(allextdirectory) that have the same name... (8 Replies)
What's the command syntax for stripping out the tar.gz file extension in a bash command line (not script file). Thanks!
prompt/> ls *.tar.gz | <what comes here?> (3 Replies)
Hi,
I have a directory which I am passing in my script as a parameter. Parameter name has been set to $TCH_FILE_DIRECTORY.
I want to know if there's atleast 1 (or more) files in this directory with the extension '.tch'. How can I find this using ksh. (4 Replies)
Quick question,
is it possible to make a Tar of completely directory and placing the tar file in it (will this cause even the tar file to tarred ?)
sample:
/opt/freeware/bin/tar -cvf - /oracle | gzip > /oracle/backup.tgz
will the tar file backup.tgz also include backup.tgz ?
i tried... (5 Replies)
Hi,
I have an inquiry on how do I use the find command in Solaris Unix to find some file ends with extension : txt, err in the root directory with modified date of 30days and this find command will also need to exclude b directory and its subdirectory. All the files from the above find criteria... (5 Replies)
Discussion started by: snowfrost88
5 Replies
LEARN ABOUT DEBIAN
cpan::perl::releases
CPAN::Perl::Releases(3pm) User Contributed Perl Documentation CPAN::Perl::Releases(3pm)NAME
CPAN::Perl::Releases - Mapping Perl releases on CPAN to the location of the tarballs
VERSION
version 0.60
SYNOPSIS
use CPAN::Perl::Releases qw[perl_tarballs];
my $perl = '5.14.0';
my $hashref = perl_tarballs( $perl );
print "Location: ", $_, "
" for values %{ $hashref };
DESCRIPTION
CPAN::Perl::Releases is a module that contains the mappings of all "perl" releases that have been uploaded to CPAN to the "authors/id/"
path that the tarballs reside in.
This is static data, but newer versions of this module will be made available as new releases of "perl" are uploaded to CPAN.
FUNCTIONS
"perl_tarballs"
Takes one parameter, a "perl" version to search for. Returns an hashref on success or "undef" otherwise.
The returned hashref will have a key/value for each type of tarball. A key of "tar.gz" indicates the location of a gzipped tar file and
"tar.bz2" of a bzip2'd tar file. The values will be the relative path under "authors/id/" on CPAN where the indicated tarball will be
located.
perl_tarballs( '5.14.0' );
Returns a hashref like:
{
"tar.bz2" => "J/JE/JESSE/perl-5.14.0.tar.bz2",
"tar.gz" => "J/JE/JESSE/perl-5.14.0.tar.gz"
}
Not all "perl" releases had "tar.bz2", but only a "tar.gz".
SEE ALSO
<http://www.cpan.org/src/5.0/>
<http://search.cpan.org/faq.html#Is_there_a_API?>
AUTHOR
Chris Williams <chris@bingosnet.co.uk>
COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Chris Williams.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
perl v5.14.2 2012-06-20 CPAN::Perl::Releases(3pm)