homepage Welcome to WebmasterWorld Guest from 54.167.249.155
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

    
Unzip files and move to another directory
AffiliateDreamer




msg:3526722
 1:45 pm on Dec 13, 2007 (gmt 0)

Hello,

I have a shared hosting account, my path is:

/user/

so I created a directory 'temp' that has my zipped up files.

/user/temp/website.zip (it is actually rar but my host doesn't have rar so I will zip it I guess)

how can I extract the files into my /user/websitename/ folder?

/user/websitename/

Also, say I just extracted the files in my /temp folder, what command would move all the contents AND the subfolders/files to my /websitename/ folder?

thanks!

 

jezra




msg:3527035
 7:17 pm on Dec 13, 2007 (gmt 0)

You could move the zip file into
/users/websitename/ and then unzip the file and hopefully everything will be where you need it to be.

In answer to your question about uzipping in /users/temp/ directory and then moving all content to the /users/websitename/ name directory, assuming you are in the /users/temp directory:

mv * /users/websitename/

will move everything in /users/temp to /users/websitename, including the original zip file.

If you want to copy everything from /users/temp into /users/websitename, you would use
cp -R * /users/websitename

Birdman




msg:3541125
 5:10 pm on Jan 5, 2008 (gmt 0)

I suggest using the -d [extdir] switch, so you don't need to move the files. Also, previous example is going to move the zip file as well and you probably don't want that.

Here's a one-liner:

unzip -d ~/user/websitename ~/user/temp/file.zip

Marty

Birdman




msg:3541178
 6:28 pm on Jan 5, 2008 (gmt 0)

Actually, those paths may be incorrect. ~/ puts you in the "user" directory, so you may need to omit the user/ part in both paths.

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