Hi,all:
I've couple of large tarballs such as www.tar and images.tar. Is it possible to extract a single file or a list of files from a large tarball such as images.tar instead of extracting the entire tarball? How do I extract specific files under Linux / UNIX operating systems?
Thanks in advance ~~
Hi,
tar [ - ] A --catenate --concatenate | c --create | d --diff --compare | --delete | r --append | t --list | u --update | x --extract --get [ options ] pathname [ pathname ... ]
pathname is what you're looking for.
Sam
________________________________
From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Majian Sent: Wednesday, November 11, 2009 9:16 AM To: CentOS mailing list Subject: [CentOS] About the tar extract signal directory~~
Hi,all:
I've couple of large tarballs such as www.tar and images.tar. Is it possible to extract a single file or a list of files from a large tarball such as images.tar instead of extracting the entire tarball? How do I extract specific files under Linux / UNIX operating systems?
Thanks in advance ~~
On 11/11/2009 09:16 AM, Majian wrote:
Hi,all:
I've couple of large tarballs such as www.tar and images.tar. Is it possible to extract a single file or a list of files from a large tarball such as images.tar instead of extracting the entire tarball? How do I extract specific files under Linux / UNIX operating systems?
Start by doing a:
tar tvf www.tar
to get a listing of the names in the tarball.
If you need to restore a specific file or directory, do a:
tar xvf www.tar ./www/specific/folder
or
tar xvf www.tar ./www/specific.file
The files are restored relative to the current directory.
The naming "./www/specific/folder" should match the list you got from the "tar tvf" command.
The restore reads the whole archive, so it can take a while.
Mogens
Majian wrote:
Hi,all:
I've couple of large tarballs such as www.tar and images.tar. Is it possible to extract a single file or a list of files from a large tarball such as images.tar instead of extracting the entire tarball? How do I extract specific files under Linux / UNIX operating systems?
man tar
Majian wrote:
Hi,all:
I've couple of large tarballs such as www.tar and images.tar. Is it possible to extract a single file or a list of files from a large tarball such as images.tar instead of extracting the entire tarball? How do I extract specific files under Linux / UNIX operating systems?
All versions of *Nix have man pages. These are like WinDoze help, except more technically detailed. T use them, do prompt> man <command or file>
It's possible to see what might be related by doing prompt> man -k <subject>
man tar
<snip> EXAMPLES tar -xvf foo.tar verbosely extract foo.tar
tar -xzf foo.tar.gz extract gzipped foo.tar.gz
tar -cjf foo.tar.bz2 bar/ create bzipped tar archive of the directory bar called foo.tar.bz2
tar -xjf foo.tar.bz2 -C bar/ extract bzipped foo.tar.bz2 after changing directory to bar
tar -xzf foo.tar.gz blah.txt extract the file blah.txt from foo.tar.gz <snip>
mark
Thanks all .
I got it ~
On Wed, Nov 11, 2009 at 10:33 PM, mark m.roth@5-cent.us wrote:
Majian wrote:
Hi,all:
I've couple of large tarballs such as www.tar and images.tar. Is it possible to extract a single file or a list of files from a large tarball such as images.tar instead of extracting the entire tarball? How do I extract specific files under Linux / UNIX operating systems?
All versions of *Nix have man pages. These are like WinDoze help, except more technically detailed. T use them, do prompt> man <command or file>
It's possible to see what might be related by doing prompt> man -k <subject>
man tar
<snip> EXAMPLES tar -xvf foo.tar verbosely extract foo.tar
tar -xzf foo.tar.gz extract gzipped foo.tar.gz tar -cjf foo.tar.bz2 bar/ create bzipped tar archive of the directory bar
called foo.tar.bz2
tar -xjf foo.tar.bz2 -C bar/ extract bzipped foo.tar.bz2 after changing directory to bar tar -xzf foo.tar.gz blah.txt extract the file blah.txt from foo.tar.gz
<snip>
mark
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos