Sponsored Content
Operating Systems Solaris option to delete .tar file while extracting Post 302278022 by bsddaemon on Monday 19th of January 2009 04:33:21 AM
Old 01-19-2009
Well, I just skimmed the man page but there is no switch that deletes the tar file after extraction.

But shell scripting would do the job fine, you just have to type a bit more (or create new alias/shell script)

Quote:
% archive_file="file.tar"; tar xf $archive_file && rm $archive_file
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

extracting from a tar file

Dear experts I have received a tar file containing several files with full path. Now I need to restore it in another system but when I want to extract files by using tar -xvf tarfile it wants to create all files with full paths again in new system in which I don't have enough previleges. How... (4 Replies)
Discussion started by: Reza Nazarian
4 Replies

2. UNIX Desktop Questions & Answers

Extracting from a tar file

Can I extract files from an archive file (tar), where the filename includes the full directory path, to a different directory? For example the archive files may have a filename of /SrcFiles/XXX/filename.dat and I want to extract it to /SrcFiles/YYY/filename.dat. Since the archive file... (1 Reply)
Discussion started by: nmalencia
1 Replies

3. UNIX for Dummies Questions & Answers

Extracting from a tar archive file

Can I extract files from an archive file (tar), where the filename includes the full directory path, to a different directory? For example the archive files may have a filename of /SrcFiles/XXX/filename.dat and I want to extract it to /SrcFiles/YYY/filename.dat. Since the archive file was... (1 Reply)
Discussion started by: nmalencia
1 Replies

4. Shell Programming and Scripting

How to read the content of the particular file from tar.Z without extracting?

Hi All, I want to read the content of the particular file from tar.Z without extracting. aaa.tar.Z contains a file called one.txt, I want to read the content of the one.txt without extracting. Please help me to read the content of it. Regards, Kalai. (12 Replies)
Discussion started by: kalpeer
12 Replies

5. Solaris

Extracting file from tar at relative location!!

Hi Gurus, I have a .tar file which required untar to the new location. I list the content with –tvf its listing the files which are inside the tar, when I am extracting he file from tar its working fine, however once I am trying to extract the file at the new location I am unable to do so. I... (11 Replies)
Discussion started by: kumarmani
11 Replies

6. UNIX for Dummies Questions & Answers

Extracting specific files from a tar file in HP-UX

I have tried: tar -xfv mytarfile.tar archive/tabv/* tar -xfv mytarfile.tar --wildcards 'archive/tabv/*' tar -xf mytarfile.tar -v --wildcards 'archive/tabv/*' tar -xfv mytarfile.tar --wildcards --no-anchored 'archive/tabv/*' tar -xfv mytarfile.tar --wildcards `archive/tabv/*` and none... (5 Replies)
Discussion started by: zapper222
5 Replies

7. Solaris

exclude absolute paths when extracting Tar file?

Hi, How do I extract data from TAR excluding absolute paths for Tar? (Solaris) Thanks (3 Replies)
Discussion started by: zam
3 Replies

8. UNIX for Advanced & Expert Users

Issue in extracting Tar and Zipped file.

Hi, I want to tar files and zip them in order to clean up space in directory. I have files like /path/file1 /path file2. What I am trying to do is: Option 1: tar -cvf /path/file1 /path file2 | gzip > test.tar.gz I got the file created. But while trying to extract the Tar and zipped file, I... (1 Reply)
Discussion started by: Quesemail
1 Replies

9. Shell Programming and Scripting

Problem extracting zipped tar file

I was extracting the zipped tar file with the command gzip -dc Sample.tar.gz |tar xf - The tar file contained many delimited files; but lately they changed the structure of the tar file with another folder. So now all the delimited files are inside a folder called "Folder1" and the folder... (6 Replies)
Discussion started by: asandy1234
6 Replies

10. OS X (Apple)

Uncompressing but not extracting tar.Z file

Hi I have a few hundred files with extension .tar.Z. These files were archived (tar) and compressed (Z) on a UNIX system. I need to unzip them but not extract them. In other words they need to go to .tar extension. I would like to do this on my MAC or on a windows pc. I do not have a UNIX... (3 Replies)
Discussion started by: kalbano
3 Replies
GIT-TAR-TREE(1) 						    Git Manual							   GIT-TAR-TREE(1)

NAME
git-tar-tree - Create a tar archive of the files in the named tree object SYNOPSIS
git tar-tree [--remote=<repo>] <tree-ish> [ <base> ] DESCRIPTION
THIS COMMAND IS DEPRECATED. Use git archive with --format=tar option instead (and move the <base> argument to --prefix=base/). Creates a tar archive containing the tree structure for the named tree. When <base> is specified it is added as a leading path to the files in the generated tar archive. git tar-tree behaves differently when given a tree ID versus when given a commit ID or tag ID. In the first case the current time is used as modification time of each file in the archive. In the latter case the commit time as recorded in the referenced commit object is used instead. Additionally the commit ID is stored in a global extended pax header. It can be extracted using git get-tar-commit-id. OPTIONS
<tree-ish> The tree or commit to produce tar archive for. If it is the object name of a commit object. <base> Leading path to the files in the resulting tar archive. --remote=<repo> Instead of making a tar archive from local repository, retrieve a tar archive from a remote repository. CONFIGURATION
tar.umask This variable can be used to restrict the permission bits of tar archive entries. The default is 0002, which turns off the world write bit. The special value "user" indicates that the archiving user's umask will be used instead. See umask(2) for details. EXAMPLES
git tar-tree HEAD junk | (cd /var/tmp/ && tar xf -) Create a tar archive that contains the contents of the latest commit on the current branch, and extracts it in /var/tmp/junk directory. git tar-tree v1.4.0 git-1.4.0 | gzip >git-1.4.0.tar.gz Create a tarball for v1.4.0 release. git tar-tree v1.4.0^{tree} git-1.4.0 | gzip >git-1.4.0.tar.gz Create a tarball for v1.4.0 release, but without a global extended pax header. git tar-tree --remote=example.com:git.git v1.4.0 >git-1.4.0.tar Get a tarball v1.4.0 from example.com. git tar-tree HEAD:Documentation/ git-docs > git-1.4.0-docs.tar Put everything in the current head's Documentation/ directory into git-1.4.0-docs.tar, with the prefix git-docs/. GIT
Part of the git(1) suite Git 1.8.3.1 06/10/2014 GIT-TAR-TREE(1)
All times are GMT -4. The time now is 05:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy