LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 07-10-2019, 10:51 AM   #1
Volcano
Member
 
Registered: Sep 2005
Posts: 225

Rep: Reputation: 15
unzip command


I have a dist.zip
inside this I have: dist/myapp/filesAndFolders
I want to extract only contents of dist/myapp

In this example I want to get filesAndFolders only.

What flag I should apply in Linux unzip command ?
 
Old 07-10-2019, 10:53 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Do you have a desktop UI? If so, you can open graphically and then double click down the folder trees and then extract just what you want. Otherwise it would be advisable to read the manual page on unzip.
 
Old 07-10-2019, 10:55 AM   #3
Volcano
Member
 
Registered: Sep 2005
Posts: 225

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by rtmistler View Post
Do you have a desktop UI? If so, you can open graphically and then double click down the folder trees and then extract just what you want. Otherwise it would be advisable to read the manual page on unzip.
No. I am not using UI.
I need to do it by unzip command.

can you please tell what to try ? any sample ?
 
Old 07-10-2019, 10:58 AM   #4
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Have you read the man page?

man unzip

-W option, maybe?

Last edited by scasey; 07-10-2019 at 11:03 AM.
 
1 members found this post helpful.
Old 07-10-2019, 11:07 AM   #5
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Quote:
Originally Posted by Volcano View Post
No. I am not using UI.
I need to do it by unzip command.

can you please tell what to try ? any sample ?
Both recommended by scasey and myself is that you should review the manual page for unzip. Check -W and -x options.
 
1 members found this post helpful.
Old 07-10-2019, 11:31 AM   #6
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
I would also add that there is a -t option which "tests" the archive, and as a result of that it prints out the filenames within the archive. This should help you to determine how best to design your wildcard term.
 
Old 07-10-2019, 03:47 PM   #7
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 2,791

Rep: Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201Reputation: 1201
-t is overkill.
-l simply lists without testing.
 
  


Reply



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
[SOLVED] Does "unzip -X" work in Info-ZIP UnZip 6.00? ruario Linux - Software 5 09-15-2013 04:21 AM
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 command with password in a script? captainhog Linux - General 1 03-29-2004 09:54 AM
unzip command options jaa1180 Linux - Software 4 11-04-2003 11:10 AM

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

All times are GMT -5. The time now is 04:46 AM.

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
Open Source Consulting | Domain Registration