Sponsored Content
Operating Systems Solaris How to extract files from a tar file without creating the directories? Post 302460999 by radoulov on Friday 8th of October 2010 07:27:53 AM
Old 10-08-2010
GNU tar has the option --transform , but I don't fully understand how it works.
May be something like this:

Code:
tar --transform 's#.*/\([^/]*\)$#\1#' -xvf <filename>

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

cant extract files from a tar file

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)
Discussion started by: bryan
2 Replies

2. UNIX for Dummies Questions & Answers

extract tar files without creating directory

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)
Discussion started by: here2learn
4 Replies

3. Shell Programming and Scripting

extract one file form .tar.gz without uncompressing .tar.gz file

hi all, kindly help me how to extract one file form .tar.gz without uncompressing .tar.gz file. thanks in advance bali (2 Replies)
Discussion started by: balireddy_77
2 Replies

4. UNIX for Dummies Questions & Answers

Creating a Tar file while files are spooling

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)
Discussion started by: sgarvan
1 Replies

5. Shell Programming and Scripting

Tar creating copies of files

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)
Discussion started by: jrymer
3 Replies

6. UNIX for Dummies Questions & Answers

Do I need to extract the entire tar file to confirm the tar folder is fine?

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)
Discussion started by: vivien_chu
1 Replies

7. Shell Programming and Scripting

Archiving and moving files into directories, creating directories, etc.

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)
Discussion started by: wyclef
5 Replies

8. Shell Programming and Scripting

Extract a tar ball into multiple directories

#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)
Discussion started by: kenshinhimura
3 Replies

9. Shell Programming and Scripting

Tar extract a multiple directories

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)
Discussion started by: kenshinhimura
1 Replies

10. Shell Programming and Scripting

Problem creating a tar ball in different directories

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
RDUP-TR(1)							       rdup								RDUP-TR(1)

NAME
rdup-tr - transform rdup output SYNOPSIS
rdup-tr [OPTION]... DESCRIPTION
Transform rdup output into something else. Where something else can be a tar, cpio, pax archive or another rdup stream. The rdup archive must be given on rdup-tr's standard input. You can select multiple types of output (-O flag), but you must be aware that you may loose some information in formats other than rdup's own, see the table below. You may also supply rdup-tr with only a list of pathnames, this can be selected with the -L flag. The following table shows what happens with the output depending on the input. 0 OK D delete information is lost H hardlink information is lost | | output | tar,cpio,pax | rdup input | | ------------- | ------------- | ------ rdup | D | 0 filelist | DH | H | | OPTIONS
-L Select list input format. Normally rdup-tr accepts rdup output, with this option you can give it a list of path names. Note: with list input rdup-tr will `stat()` each file. -O Output format. This can be 'tar', 'cpio', 'pax' or 'rdup'. It defaults to 'rdup'. -X key Read the encryption key from the file key and encrypt all paths with Blowfish and this key and iv. After the encryption the binary data is converted into ASCII using an URL safe (Section 4 of RFC 3548) version of base64 encode. The encryption key must be on the first line and the key size must be 16 and 8 bytes for the iv, so 24 in total. -Y key Read the decryption key from the file key and decrypt all paths with Blowfish and this key. Before the encryption the paths are con- verted to binary by using an URL safe version of base64 decode. -c Force output to the tty. Normally rdup-tr wants to see it's output redirected. -v Be more verbose. -V Print rdup-tr's version. -h A short help. EXAMPLES
The following is possible rdup -Pgzip -Pmcrypt,-f,KEY,-c /dev/null /home | rdup-tr -O tar -X<(echo secret) | gzip > my-home-zipped-crypted-pathcrypted-tar.gz That is: all files under /home are gzipped and encrypted on a per file basis (first line). Further more, all pathnames are Blowfish encrypted (second line) with the key 'secret'. This is put in a tar file, which is then compressed, resulting in the final output (final line). Creating a compressed and encrypted tar archive out of a full rdup dump might be done as follows rdup -Pgzip -Pmcrypt,-f,KEY,-c /dev/null /home | rdup-tr -O tar > my-home-zipped-and-crypted.tar Or even pack and unpack it on the fly rdup -Pgzip -Pmcrypt,-fKEY,-c /dev/null /home | rdup-tr -Otar | ssh user@remotehost tar xvCf /tmp - Or encryption with openssl rdup -Popenssl,enc,-e,-des-cbc,-k,secret /dev/null /home Or, compressing with gzip, encrypting with openssl and then compressing the entire archive yet again rdup -Pgzip -Popenssl,enc,-e,-des-cbc,-k,secret /dev/null /home | gzip > my_compressed_encrypted_rdup_archive.gz Recreating the original rdup output, which can be fed to rdup-up. gunzip -c my_compressed_encrypted_rdup_archive.gz | rdup-tr -Popenssl,enc,-d,-des-cbc,-k,secret -Pgzip,-d > my_rdup_archive rdup-up < my_rdup_archive -t /tmp/restore Notice the reversal of the -P options. EXIT CODE
rdup-tr return a zero exit code on success, otherwise 1 is returned. AUTHOR
Written by Miek Gieben. REPORTING BUGS
Report bugs to <miek@miek.nl>. SEE ALSO
http:/www.miek.nl/projects/rdup/ is the main site of rdup. Also see rdup(1), rdup-up(1) and rdup-backups(7). COPYRIGHT
Copyright (C) 2005-2010 Miek Gieben. This is free software. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Licensed under the GPL version 3. See the file LICENSE in the source distribution of rdup. 1.1.11 27 Nov 2008 RDUP-TR(1)
All times are GMT -4. The time now is 02:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy