homepage Welcome to WebmasterWorld Guest from 54.204.127.191
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
Forum Library, Charter, Moderators: bakedjake

Linux, Unix, and *nix like Operating Systems Forum

    
How to unzip files in root?
what is the commond?
tabish




msg:3348844
 4:28 pm on May 24, 2007 (gmt 0)

Hello,

I am extracting a file called "foo.zip" using command:

unzip foo.zip

it is working fine but the problem is, it is Making a directory called "foo" and extracts all the file/subdirectories under that "foo" directory, while i want to extract all the files/directories in root.

I dont want unzip command to create a directory called "foo"

how is that possible?

Regards

 

wheel




msg:3349129
 9:56 pm on May 24, 2007 (gmt 0)

You can't do directly what you want AFAIK. The file wasn't created as a bunch of files, it was created as a bunch of files inside a directory, then the directory was zipped.

Simple fix, unzip then:
cd foo
cp * /path to root
cd ..
rm -Rf foo

(in other words, unzip to foo, go into foo, move files where you want them, then delete the foo directory)

wheel




msg:3349130
 9:57 pm on May 24, 2007 (gmt 0)

I say that emphatically, yet I bet there's some zip command to unzip just specific files - to do what you're asking. But it seems that the above solution (which is what I use) is easy to remember and easy to use.

mcavic




msg:3349183
 11:03 pm on May 24, 2007 (gmt 0)

Just type unzip, and you'll get a help file. Mine says -j will ignore the paths and extract everything to the current directory.

tabish




msg:3349448
 6:43 am on May 25, 2007 (gmt 0)

cp * /path to root

This is only moving files, not folders :(

iwannano1




msg:3350645
 3:50 pm on May 26, 2007 (gmt 0)

mv path /root

wheel




msg:3351799
 4:06 pm on May 28, 2007 (gmt 0)

cp -R * /path/to/move/to

that'll do it.

mcavic




msg:3351944
 7:41 pm on May 28, 2007 (gmt 0)

-

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved