Extract compressed tarball to folder?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Extract compressed tarball to folder?
# 1  
Old 11-30-2012
Extract compressed tarball to folder?

This is for Red Hat Enterprise Linux Client release 5.7 (Tikanga).

Wanna extract entire contents of a tar.gz to a folder of my choosing. Thanks
# 2  
Old 11-30-2012
The tarball has to have relative paths - ie.,
Code:
./somefile or ./somedir/somefile

Be sure you have relative paths:
Code:
tar xft tar.gz | head

extract:
Code:
cd somedir
tar zxf tar.gz

# 3  
Old 11-30-2012
Quote:
Originally Posted by jim mcnamara
...
Be sure you have relative paths:
Code:
tar xft tar.gz | head

...
@Jim
I suppose you meant
Code:
tar zft tar.gz | head

Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Creating a tarball on Solaris issue with errors

Hi All, We are planning to migrate from Solaris to AIX, and we have a requirement to move all files modified in last 7 days to AIX. i found many helpful forums on this site but somehow the issue was still not solved: Used the following command from the directory which we want to scan ... (6 Replies)
Discussion started by: nikhil8
6 Replies

2. Shell Programming and Scripting

Self extracting tarball

I was wondering if anyone can point me to some topics, material, or tutorials that can help me write a shell script that creates a second script that is a Self-extracting tarball. Don't want any actual code obviously because this is a school project, but I feel my teacher didn't well cover the... (3 Replies)
Discussion started by: canes27
3 Replies

3. Shell Programming and Scripting

tarball of current directory

I wanna make a backup tarball. I wanna write a script that makes tarball of the current directory. There are lots of files so I cant type all files, I wanna make the tarball by excluding few files. Like there 1000 files in a directory I wanna create a tarball containing 98 files of that... (1 Reply)
Discussion started by: nishrestha
1 Replies

4. Shell Programming and Scripting

Unpack individual files from tarball

Say you don't want to unpack the whole thing, just individual files or directories within a .tgz. How to do this? (1 Reply)
Discussion started by: stevensw
1 Replies

5. Shell Programming and Scripting

Need to extract a folder from a full path

Hi everyone, I have different folders which looks like this: /mnt/ecrm/master/ecrm/templates/brochure/de_DE/zeitlos.ott /mnt/ecrm/master/ecrm/templates/mail/en_US/default.html /templates/header_and_footer/en_US/default.txt I want to get the bold text only in a variable. I already have a... (3 Replies)
Discussion started by: evilass
3 Replies

6. Emergency UNIX and Linux Support

Extract particular folder from a .tar format files.

Hi All- I want to extract a particular folder from .tar format files. For example: File Name: backup.tar The backup.tar contains the below folders & files. 1) /root_folder/Folder1/Folder1-1/* 2) /root_folder/Folder1/Folder1-2/* 3) /root_folder/Folder2/Folder2-1/* 4)... (5 Replies)
Discussion started by: k_manimuthu
5 Replies

7. UNIX for Dummies Questions & Answers

How to extract contents of ONLY one directory from ZIP folder.

I have a ZIP folder ( folder.zip or folder.jar ) which contains , lets say 3 directories under it ( directory1, directory2, directory3). How can i unzip the contents of directory2 ONLY ? I do not have to unzip the complete folder. TIA. (2 Replies)
Discussion started by: Sheel
2 Replies

8. UNIX for Advanced & Expert Users

how to grep/read a file inside compressed tgz without extract?

Hi all, I would like to ask whether in Unix shell/perl have any functions or command to allow grep/cat/read a file inside compressed .tgz without extract it? I know we can tar tvf a compressed tgz but this only allow we read the path/filename contained inside the tarball. If we want to read... (3 Replies)
Discussion started by: mayshy
3 Replies

9. UNIX for Dummies Questions & Answers

Is there any way to add to a tarball made in this fashion

Hello, I am wondering if there is an easy way to add a file to a tarball rather than extracting, adding, then remaking the tarball. The tarball was made in this way: tar -cpvzf .wine.tar.gz .wine/If I had a file to the .wine/ dir (or if I just wanted to add a file to the tarball), I would... (4 Replies)
Discussion started by: Narnie
4 Replies

10. Solaris

extract tar.gz under a specific folder

Hi, How to extract a tar.gz file and put it under a designated folder that I specify in a one line command? thank you in advance. (3 Replies)
Discussion started by: melanie_pfefer
3 Replies
Login or Register to Ask a Question