Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 9th January 2009, 07:23 AM
youhaodeyi Offline
Registered User
 
Join Date: May 2007
Posts: 217
How to extract a tar file and change its path

I have a tar file(test.tar) which content is:

src/com/package/test.h

when I extract this file by 'tar -xvf test.tar', it will create the directory 'src/com/package' in the current directory. I want to remove the directory 'src/com' which means after extract the tar, only 'com/package/test.h' is extracted. How can I do this?
Reply With Quote
  #2  
Old 9th January 2009, 07:32 AM
slashslash Offline
Registered User
 
Join Date: Jan 2009
Posts: 7
You could copy the com directory to the destination you want it and then remove the src directory.
Reply With Quote
  #3  
Old 9th January 2009, 09:54 AM
leigh123linux's Avatar
leigh123linux Offline
Retired Administrator
 
Join Date: Oct 2006
Posts: 21,509
file-roller will do it .


Code:
file-roller
__________________
My Hardware
- CPU: AMD Phenom II X6 Hex Core 1055T 95W Edition @3.5Ghz
- Motherboard: Gigabyte GA-880GM-UD2H
- Cooler: Corsair H50 CPU Cooler
- RAM: Corsair Dominator 8GB (4x2GB) DDR3 1600MHz
- Graphics: Gigabyte GeForce GTS 450 OC 1024MB GDDR5
Reply With Quote
  #4  
Old 9th January 2009, 01:54 PM
giulix's Avatar
giulix Offline
"Fixed" by (vague) request
 
Join Date: Oct 2005
Location: GMT+ 1
Posts: 2,950
See also the --strip-path NUMBER/--strip-components NUMBER (1) options to tar.

(1) tar-1.14 uses --strip-path, tar-1.14.90+ uses --strip-components
Reply With Quote
Reply

Tags
change, extract, file, path, tar

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Extract audio from avi file billy123 Using Fedora 3 21st April 2008 04:51 PM
how to extract the contents of a .bin file???? buchalkalan Using Fedora 3 28th June 2006 10:07 PM
Change default extract application smkamene Using Fedora 0 24th November 2005 11:35 PM
extract iso file. thnguyen Using Fedora 1 28th August 2005 04:22 AM
how to extract tr.gz file ? SharkSoftware69 Using Fedora 5 17th September 2004 05:56 PM


Current GMT-time: 15:53 (Tuesday, 21-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat