Sponsored Content
Top Forums UNIX for Dummies Questions & Answers tar command help -- extract single file Post 302210434 by zaxxon on Tuesday 1st of July 2008 02:48:29 AM
Old 07-01-2008
Usually in your pwd where you currently are. If done non-interactive via script and cronjob for example, you should do a cd to be sure, you are at the place in the filesystem, where you want to be.
I avoid to tar stuff with a leading slash. So I can always move to a tmp directory and extract there to avoid overwriting.
It's always a bad surprise if some &*!@$! (to have it in comic speech censorship) creates an archive with absolute path. That can cause an unwanted update of your data heh.
 

10 More Discussions You Might Find Interesting

1. 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

2. UNIX for Advanced & Expert Users

how to unzip and extract tar file in single command

In order to save diskspace and avoid of disk full during unzip then extract the tar file is there any tar unzip command would unzip and extract tar at the same time (test123.tar.gz) thank in advance (6 Replies)
Discussion started by: darkrainbow
6 Replies

3. Shell Programming and Scripting

tar: extract single file to different filepath

Hi, This is my first post here - I'm hoping I can get some help! I have searched these forums and othersand not getting anything that works. I am trying to extract a single file from a tar archive to a diffierent location than it will default to. For example my tar log shows me ... a... (3 Replies)
Discussion started by: littleIdiot
3 Replies

4. UNIX for Advanced & Expert Users

What is command to extract single file from an archieve?

I just want to extract one sigle file from an .ear archieve instead of extracting whole ear. Can anyone help me on this? (4 Replies)
Discussion started by: harshal_dcx
4 Replies

5. UNIX for Dummies Questions & Answers

Restoring a single file from a group of files using tar

Hello I take a backup using the following command on Solaris 9 tar cvf /dev/rmt/0n data the data volume contains a number of files say a, b, c , d ... etc Now I want to restore only one file (eg b) from the data volume. When I issue the command tar xvf /dev/rmt/0n data/b... (1 Reply)
Discussion started by: rahmantanko
1 Replies

6. Shell Programming and Scripting

Single command - unzip files from a tar command

I have a tar file that contains multiple .Z files. Hence I need to issue a tar command followed by a gzip command to fully extract the files. How do I do it in a single command? What I'm doing now is tar xvf a.tar (this will output 1.Z and 2.Z) gzip -d *.Z (to extract 1.Z and 2.Z) (9 Replies)
Discussion started by: ericlim
9 Replies

7. 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

8. Shell Programming and Scripting

Extract a single file from a tar file to another directory

Hi, I need to extract a single file from a tar file to another directory. So far I have this: This one extract a single file to same directory: tar -xvf filename.tar ./file.txt I tried this but its not working tar -xvf filename.tar /home/dir ./file.txt or this: (6 Replies)
Discussion started by: erin00
6 Replies

9. UNIX for Dummies Questions & Answers

UNIX command to check if file name ends with .tar OR if the file is a tar file

Hello Team, Would you please help me with a UNIX command that would check if file is a tar file. if we dont have that , can you help me with UNIX command that would check if file ends with .tar Thanks in advance. (10 Replies)
Discussion started by: sanjaydubey2006
10 Replies

10. UNIX for Beginners Questions & Answers

Tar and unzip on single command

Hi All, First of all I don't know whether this is possible. or no. Thought of getting experts thought. I am having a tar file which contains zipped file in it . I tried individual command with extraction and it worked tar -tvf TRANS_279.tar -rw-rw-r-- qqa00 1394 2016-10-03 10:39:19... (8 Replies)
Discussion started by: arunkumar_mca
8 Replies
bup-meta(1)						      General Commands Manual						       bup-meta(1)

NAME
bup-meta - create or extract a metadata archive SYNOPSIS
bup meta --create [-R] [-v] [-q] [--no-symlinks] [--no-paths] [-f file] <paths...> bup meta --list [-v] [-q] [-f file] bup meta --extract [-v] [-q] [--numeric-ids] [--no-symlinks] [-f file] bup meta --start-extract [-v] [-q] [--numeric-ids] [--no-symlinks] [-f file] bup meta --finish-extract [-v] [-q] [--numeric-ids] [-f file] DESCRIPTION
bup meta either creates or extracts a metadata archive. A metadata archive contains the metadata information (timestamps, ownership, access permissions, etc.) for a set of filesystem paths. OPTIONS
-c, --create Create a metadata archive for the specified paths. Write the archive to standard output unless --file is specified. -t, --list Display information about the metadata in an archive. Read the archive from standard output unless --file is specified. -x, --extract Extract a metadata archive. Conceptually, perform --start-extract followed by --finish-extract. Read the archive from standard input unless --file is specified. --start-extract Build a filesystem tree matching the paths stored in a metadata archive. By itself, this command does not produce a full restora- tion of the metadata. For a full restoration, this command must be followed by a call to --finish-extract. Once this command has finished, all of the normal files described by the metadata will exist and be empty. Restoring the data in those files, and then calling --finish-extract should restore the original tree. The archive will be read from standard input unless --file is specified. --finish-extract Finish applying the metadata stored in an archive to the filesystem. Normally, this command should follow a call to --start- extract. The archive will be read from standard input unless --file is specified. -f, --file=filename Read the metadata archive from filename or write it to filename as appropriate. If filename is "-", then read from standard input or write to standard output. -R, --recurse Recursively descend into subdirectories during --create. --numeric-ids Apply numeric user and group IDs (rather than text IDs) during --extract or --finish-extract. --symlinks Record symbolic link targets when creating an archive, or restore symbolic links when extracting an archive (during --extract or --start-extract). This option is enabled by default. Specify --no-symlinks to disable it. --paths Record pathnames when creating an archive. This option is enabled by default. Specify --no-paths to disable it. -v, --verbose Be more verbose (can be used more than once). -q, --quiet Be quiet. EXAMPLES
# Create a metadata archive for /etc. $ bup meta -cRf etc.meta /etc bup: removing leading "/" from "/etc" # Extract the etc.meta archive (files will be empty). $ mkdir tmp && cd tmp $ bup meta -xf ../etc.meta $ ls etc # Restore /etc completely. $ mkdir tmp && cd tmp $ bup meta --start-extract -f ../etc.meta ...fill in all regular file contents using some other tool... $ bup meta --finish-extract -f ../etc.meta BUGS
Hard links are not handled yet. BUP
Part of the bup(1) suite. AUTHORS
Rob Browning <rlb@defaultvalue.org>. Bup unknown- bup-meta(1)
All times are GMT -4. The time now is 06:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy