LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-17-2013, 07:48 AM   #1
yashfire007
Member
 
Registered: Jan 2013
Distribution: CentOS, RHEL 6.4
Posts: 79

Rep: Reputation: Disabled
Unzip


How to unzip a single file from a zip file.
I have tried the command #unzip files.zip file4
but still the file4 is visible in the files.zip.
 
Old 01-17-2013, 08:07 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
So you want to extract a single file from the archive and delete it? I don't know if you can do it in a single command, but this one should work:
Code:
unzip files.zip file4 && zip -d files.zip file4
The first part extracts file4 from the archive (as you suggested above) and if it's successful (&&) the second part delete file4 from the archive. Is this what you're looking for?
 
Old 01-17-2013, 08:12 AM   #3
yashfire007
Member
 
Registered: Jan 2013
Distribution: CentOS, RHEL 6.4
Posts: 79

Original Poster
Rep: Reputation: Disabled
Okay first tell me one thing
After we unzip a single file from a zip file. will the unzipped file still visible in the zip file.
 
Old 01-17-2013, 08:33 AM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
Yes. Unzipping a single file doesn't mean it is removed from the archive: it is extracted and the archive is left untouched.
 
Old 01-17-2013, 08:38 AM   #5
yashfire007
Member
 
Registered: Jan 2013
Distribution: CentOS, RHEL 6.4
Posts: 79

Original Poster
Rep: Reputation: Disabled
okay thank you for your support....
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the difference between using "jar xvf" and "unzip" to unzip the zip-file? thomas2004ch Linux - Newbie 4 08-27-2009 05:11 AM
about unzip to unzip some chinese files' trouble arcow Linux - Software 0 03-24-2006 02:25 AM
Unzip Jmcatch742 Linux - Software 4 08-01-2004 12:52 PM
how do you unzip something slacker2007 Linux - Newbie 2 08-01-2004 11:19 AM
Unzip PhuckFonix Linux - Newbie 1 05-30-2004 08:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration