Unzip subfolder to some path.


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Unzip subfolder to some path.
# 1  
Old 11-09-2009
Unzip subfolder to some path.

I have a zip file (somezipfile.zip) with the following contents in it:

dir1/subdir1/somefile1.txt
dir1/subdir2/somefile2.txt
dir1/subdir2/somefile3.txt
dir1/somefile3.txt
dir1/somefile4.txt
dir2/somefile5.txt
dir2/somefile6.txt

Lets say I unzip this to my home directory so now I have:

/home/me/dir1/subdir1/somefile1.txt
/home/me/dir1/subdir2/somefile2.txt
/home/me/dir1/subdir2/somefile3.txt
/home/me/dir1/somefile3.txt
/home/me/dir1/somefile4.txt
/home/me/dir2/somefile5.txt
/home/me/dir2/somefile6.txt

Now I do rm -rf /home/me/dir1/subdir2:
/home/me/dir1/subdir1/somefile1.txt
/home/me/dir1/somefile3.txt
/home/me/dir1/somefile4.txt
/home/me/dir2/somefile5.txt
/home/me/dir2/somefile6.txt

How can I unzip ONLY the subdir2 folder and the files it contains into the /home/me/dir1 folder without freshening or touching the other directories?

Also consider I may have subdirectories within subdir2 as well.

All responses are greatly appreciated. Thanks in advance.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Unzip the .zip file without using unzip utility in UNIX

I have .zip file, i want to list all the files archived in the zip file. unzip utility is not working for me in unix. Please help me resolve this issue Thanks ganesh. (3 Replies)
Discussion started by: Ganesh L
3 Replies

2. UNIX for Dummies Questions & Answers

Unzip & Env Path Name

I need to download team foundation server on Unix (4 simple instructions below), but I am stuck.. I am newbie Unix user, so please be patient. -cd /home/Myname/Downloads, Unzip -Unzipped to /home/Myname/DestFolder -cd DestFolder, type tf -help, works there - outside this folder, doesn't... (1 Reply)
Discussion started by: software2007
1 Replies

3. Shell Programming and Scripting

Link multiple files from different subfolder to a new subfolder

Hi, I have the following subfolder with files: /data/a/1/xxx.txt /data/b/2/yyy.txt /data/c/3/zzz.txt And i have a set of new folders which have exactly the same structure as above but different disk without the files: /data_02/a/1/ /data_02/b/2/ /data_02/c/3/ Now i would like to... (6 Replies)
Discussion started by: total_ysf
6 Replies

4. Shell Programming and Scripting

How to Unzip a file using unzip utility for files zipped without zip utility ?

Hi, I need to zip/compress a data file and send to a vendor. The vendor does have only unzip utility and can accept only .ZIP files. I do not have zip utility in my server. How do I zip/compress the file so that it can be deflated using unzip command ? I tried gzip & compress commands, but... (1 Reply)
Discussion started by: Sabari Nath S
1 Replies

5. UNIX for Dummies Questions & Answers

How to Get the count fo files in each subfolder

Hi is there a command to get the count of files inside each sub directory in a directory. example: in a directory like this /opt/:> ls subdir1 subdir2 subdir3 I need to see the count of files in sub directories like this: /opt/subdir1: 3 files /opt/subdir2: 5 files /opt/subdir3: 10... (1 Reply)
Discussion started by: sanjangr
1 Replies

6. UNIX and Linux Applications

Samba read only subfolder.

Hi, I need to make a folder read only under a fileshare that has full permissions granted to it. The fileshare with full permissions is /u02/prodfileshare. The folder I need to make read only for everyone except the owner of the folder is called /u02/prodfileshare/EFT/purchases. ... (0 Replies)
Discussion started by: sparcman
0 Replies

7. Shell Programming and Scripting

unzip few files but with same path and file name.

Hi Everyone, For exmaple, i have 5 .zip files. So i can do "unzip -L -o file1.zip -d /home/user1" for every 5 files. But the problem is those 5 zip files, have same path and file name. So if i use "-o", all will be overwirte. The output is unzip all files, but put all unzipped files... (1 Reply)
Discussion started by: jimmy_y
1 Replies

8. Shell Programming and Scripting

How to Unzip a .ZIP file in Unix without using unzip cmd..?????

Hi All I have ftped a .ZIP file (zipped using WinZip in Windows) to my Unix server (HP-UX). I don't have unzip cmd available in my curent Unix version Please let me know any cmd in UNIX (other than unzip) using which I can unzip this .ZIP file . Please elaborate on the commands aval and... (5 Replies)
Discussion started by: sureshg_sampat
5 Replies

9. Shell Programming and Scripting

Get zip path from unzip -l

I am listing the contents of a zip file and then grepping for a specific string ie: filename.a to get a line like: 309753 10-18-08 15:20 etc/filename.a The etc/filename.a is the path the file is at within the zip file...how might I capture this path as I want to use that path to unzip that... (2 Replies)
Discussion started by: phreezr
2 Replies

10. HP-UX

How to Unzip a .ZIP file in Unix without using unzip cmd..?????

Hi All I have ftped a .ZIP file (zipped using WinZip in Windows) to my Unix server (HP-UX). I don't have unzip cmd available in my curent Unix version Please let me know any cmd in UNIX (other than unzip) using which I can unzip this .ZIP file . Please elaborate on the commands aval and... (5 Replies)
Discussion started by: sureshg_sampat
5 Replies
Login or Register to Ask a Question
mhddfs(1)						      General Commands Manual							 mhddfs(1)

NAME
mhddfs - The driver combines a several mount points into the single one. SYNOPSIS
mhddfs /dir1,/dir2[,/path/to/dir3] /path/to/mount [-o options] mhddfs /dir1 dir2,dir3 /mount/point [-o options] ... fusermount -u /path/to/mount fstab record example: mhddfs#/path/to/dir1,/path/to/dir2 /mnt/point fuse defaults 0 0 mhddfs#/dir1,/dir2,/dir3 /mnt fuse logfile=/var/log/mhddfs.log 0 0 OPTIONS
with an -o option1,option2... you can specify some additional options: logfile=/path/to/file.log specify a file that will contain debug information. loglevel=x 0 - debug messages 1 - info messages 2 - standard (default) messages mlimit=size[m|k|g] a free space size threshold If a drive has the free space less than the threshold specifed then another drive will be choosen while creat- ing a new file. If all the drives have free space less than the threshold specified then a drive containing most free space will be choosen. Default value is 4G, minimum value is 100M. This option accepts suffixes: [mM] - megabytes [gG] - gigabytes [kK] - kilobytes For an information about the additional options see output of: mhddfs -h DESCRIPTION
The file system allows to unite a several mount points (or directories) to the single one. So a one big filesystem is simulated and this makes it possible to combine a several hard drives or network file systems. This system is like unionfs but it can choose a drive with the most of free space, and move the data between drives transparently for the applications. While writing files they are written to a 1st hdd until the hdd has the free space (see mlimit option), then they are written on a 2nd hdd, then to 3rd etc. df will show a total statistics of all filesystems like there is a big one hdd. If an overflow arises while writing to the hdd1 then a file content already written will be transferred to a hdd containing enough of free space for a file. The transferring is processed on-the-fly, fully transparent for the application that is writing. So this behaviour simu- lates a big file system. WARNINGS The filesystems are combined must provide a possibility to get their parameters correctly (e.g. size of free space). Otherwise the writing failure can occur (but data consistency will be ok anyway). For example it is a bad idea to combine a several sshfs systems together. Please read FUSE documentation for a further conception. COPYRIGHT
Distributed under GPLv3 Copyright (C) 2008 Dmitry E. Oboukhov <dimka@avanto.org> February 2008 mhddfs(1)