|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Solaris The Solaris Operating System, usually known simply as Solaris, is a Unix-based operating system introduced by Sun Microsystems. The Solaris OS is now owned by Oracle. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
HOW TO extract.tar file to specific directory..?
Hi all, In Solaris howto extract tar file to specific folder. This is what we do in Linux, but how to do the same thing in Solaris ? Code:
-tar -xzvf /tmp/etc.tar.bz -C /tmp (Will extract in /tmp dir) Code:
3.gzip COMPRESSION AND EXTRACTION -tar -czvf /tmp/etc.tar.bz /etc -du -csh /tmp/etc.tar.bz 7.4M -tar -xzvf /tmp/etc.tar.bz -tar -xzvf /tmp/etc.tar.bz -C /tmp (Will extract in /tmp dir) Last edited by Scott; 02-02-2013 at 10:34 AM.. Reason: Formatting |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
Usually, the tar has a relative path, which you can see in the t output. It will make the leading directory if any. So, run tar in the target directory where you want that subtree: Code:
( cd somewhere ; tar xf - ) < whatever.tar |
| The Following User Says Thank You to DGPickett For This Useful Post: | ||
manalisharmabe (02-03-2013) | ||
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
Lets say you want to tar testzone.tar in /zones directory Code:
# mv testzone.tar /zones # cd /zones verify that the file is in the /zones director # ls # tar xf testzone.tar # ls Last edited by Scott; 02-02-2013 at 10:34 AM.. Reason: Code tags |
| The Following User Says Thank You to cjashu For This Useful Post: | ||
manalisharmabe (02-03-2013) | ||
|
#4
|
|||
|
|||
|
Hi cjashu
What you say is right but, if I need to write in script extract in particular directory then your method wont work. May be what DGPickett said would work... |
| Sponsored Links | |
|
|
#5
|
|||
|
|||
|
Unix tar does not have a built-in (de)compression. The advantage is that the newest (de)compression methods can be used without updating the tar binary. The disadvantage is that you must get used to complex shell code. Example: Code:
bunzip2 -c whatever.tar.bz2 | ( cd somewhere && tar xvf - ) The && is safer than the semicolon. |
| Sponsored Links | |
|
|
#6
|
|||
|
|||
|
Yes, more generally, just decompress stdin: Code:
any_appropriate_decompress_tool <yours.some_comp_tar_ext | ( cd somewhere && tar xvf - ) gunzip or gzcat for .tgz, .tar.gz and .tar.Z, uncompress for tar.Z, bunzip2 for .tbz or .tar.bz2 Pipes are neat for moving stuff through rsh/ssh to another host without making a local copy of the compressed file. |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| extract tar.gz under a specific folder | melanie_pfefer | Solaris | 3 | 02-24-2009 09:20 AM |
| tar extract to different directory | ammu | UNIX for Advanced & Expert Users | 1 | 07-25-2007 10:54 AM |
| extract tar files without creating directory | here2learn | UNIX for Dummies Questions & Answers | 4 | 10-02-2006 07:42 PM |
| extract a sub directory form a tar file | Optimus_P | UNIX for Advanced & Expert Users | 2 | 01-28-2004 12:23 PM |
| redirecting tar extract to another directory | colesy | UNIX for Dummies Questions & Answers | 7 | 01-28-2003 03:40 AM |
|
|