unzip in same directory


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users unzip in same directory
# 1  
Old 02-28-2011
unzip in same directory

I want to unzip two files into one directory called database. how can i do that ?

I used:
Code:
unzip filename_1.zip -d database

and
Code:
unzip filename_2.zip -d database

It is creating a database folder and inside it 2 folders filename_1 and filename_2. i want it to create the contents directly under the "database folder".
I want the contents of filename_1.zip and filename_2.zip to be directly under directory database.

Moderator's Comments:
Mod Comment Please use [code] and [/code] tags when posting code, data or logs etc. to preserve formatting and enhance readability, thanks.

Last edited by zaxxon; 03-01-2011 at 05:21 AM.. Reason: code tags
# 2  
Old 03-01-2011
You may want the option to disable relative paths (-j), if any. Create the database dir yourself and run unzip in there.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Unzip Multiple zip files and Strip directory

I receive multiple zipped directories with files in them, so the .zip name is the name of the directory containing the files. so i have used a simple loop to unzip all of them but when unzipped i have folders/directories, i wanted to strip these directories and remain with the actual files from... (1 Reply)
Discussion started by: buggzdiq
1 Replies

2. 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

3. UNIX for Advanced & Expert Users

Unzip Help

Hello All, I am trying to write a shell script(linux) where it just unzips the abc.zip file in the same folder. If I write unzip abc.zip in my shell script and try to run the shell script I am getting Error : ?Invalid command But when I run the command unzip abc.zip at the command prompt... (5 Replies)
Discussion started by: su2
5 Replies

4. SCO

Unzip

Hi, I have installed Unzip 5.3 on SCO Unix 5.05 Openserver and it successfully installs but when I go to unzip a file by using unzip <filename> I get ksh: unzip: not found . Any ideas?:o (1 Reply)
Discussion started by: twitchmaker
1 Replies

5. 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

6. 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

7. UNIX for Dummies Questions & Answers

unzip!!!!!!

Hi, How to find the size of a zipfile after unzipping without unziping it? Pls let me know if anyone has idea abtit. Thanks (1 Reply)
Discussion started by: rags_s11
1 Replies

8. Programming

Not able to use NFS mounted directory as buffer for untar & unzip.

Hi, For a new requirement, we are trying to use NFS mounted directory as the buffer (TMP_DIR) for untar. Target OS- VxWorks Host OS - Windows Embedded. mounted a directory in wondows onto VxWorks. During untar process of GNU we come across utime, for chaning the time stamp of the... (0 Replies)
Discussion started by: suraj.bc
0 Replies

9. UNIX for Dummies Questions & Answers

How to unzip multiple files (encrypted) in a directory.

Good day all. I want to unzip multiple files in a directory. Suppose there are two files: test.txt.zip and test1.txt.zip Using this command: unzip -o -P test*.zip results in the unzipping of the first file not second. It gives this error: Archive: test.txt.zip caution: filename not... (2 Replies)
Discussion started by: er_ashu
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