Welcome to WebmasterWorld Guest from 54.167.177.207

Forum Moderators: bakedjake

How to unzip files in root?

what is the commond?

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

5+ Year Member



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

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

WebmasterWorld Senior Member wheel is a WebmasterWorld Top Contributor of All Time 10+ Year Member



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)

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

WebmasterWorld Senior Member wheel is a WebmasterWorld Top Contributor of All Time 10+ Year Member



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.
11:03 pm on May 24, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just type unzip, and you'll get a help file. Mine says -j will ignore the paths and extract everything to the current directory.
6:43 am on May 25, 2007 (gmt 0)

5+ Year Member



cp * /path to root

This is only moving files, not folders :(

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

5+ Year Member



mv path /root
4:06 pm on May 28, 2007 (gmt 0)

WebmasterWorld Senior Member wheel is a WebmasterWorld Top Contributor of All Time 10+ Year Member



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

that'll do it.

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

WebmasterWorld Senior Member 10+ Year Member



-
 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month