Print Only File Name in Zip File With out Unzipping It


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Print Only File Name in Zip File With out Unzipping It
# 1  
Old 04-08-2014
Print Only File Name in Zip File With out Unzipping It

How i print just only the file name in the zip file.

Code:
unzip -l AAC_20130930_v13.xml.zip
Archive:  AAC_20130930_v13.xml.zip
  Length     Date   Time    Name
 --------    ----   ----    ----
 62665745  11-19-13 10:43   AAC_20130930_v13.xml
 --------                   -------
 62665745                   1 file

The closest i got it is.

Code:
unzip -l AAC_20130930_v13.xml.zip | awk '{print $4}' | sed '/^$/d'
Name
----
AAC_20130930_v13.xml

Thank you.
# 2  
Old 04-08-2014
Check zipinfo.
# 3  
Old 04-08-2014
You could also try:
Code:
unzip -l AAC_20130930_v13.xml.zip | awk 'NR > 3 && NF == 4 {print $4}'

This User Gave Thanks to Don Cragun For This Post:
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to remove new line in file after unzipping the file?

I wrote my unix archive script to move the zip files from unix input folder to windows folder,the zip files got successful transfered but while iam unzipping them in windows folder a new line is getting appended in my file.. how can i remove that new line..? (6 Replies)
Discussion started by: hemanthsaikumar
6 Replies

2. Shell Programming and Scripting

Finding a text file from a group of zip files without unzipping

HI , There are more than 100 zip files in a directory and i wanted to see if there is a max1157.txt file in any of the zip files without actually unzipping them. Could you please help. Thanks in Advance. Karthik. (6 Replies)
Discussion started by: karthikk0508
6 Replies

3. UNIX for Dummies Questions & Answers

How to know the Original size of the file without unzipping the File?

Hi, I don't have enough space on my Unix Box. So, I can't unzip the file and check the size of the file. So, I need to know, Is there any command, to check, how much the unzipped file takes after unzipping. Thanks in Advance. (4 Replies)
Discussion started by: Siva Sankar
4 Replies

4. UNIX for Dummies Questions & Answers

Unzipping windows zip files on Sun sparc workstation

I've got to install and compile some C++ source code that has been developed on a windows box on a Sun sparc workstation. Can I simply e-mail myself some windows zip files and then download and unzip them on the sparc box? I've tried this on a linux openSUSE machine and it works fine but I'm not... (4 Replies)
Discussion started by: achartley
4 Replies

5. Shell Programming and Scripting

Unzipping a file in Solaris - Issue with xls file

Hi, I have an excel file generated by system in windows. I am zipping it, transfering to unix and unzipping there. But i'm getting below output while unzipping. $ /usr/bin/unzip -a 123.zip -d . Archive: 123.zip inflating: ./123/Index.xls When i copy this unzipped xls file to... (0 Replies)
Discussion started by: ajaykumarb
0 Replies

6. Shell Programming and Scripting

Unzipping latest zip file by name.

I have these zip files that come in with the same name, but different versions. We'll say: SQL_version2.zip SQL_version3.zip SQL_version2432.zip I was wondering if there is a single command (or even piped command, thus still making it a single command) that will let me unzip the latest... (3 Replies)
Discussion started by: mrwatkin
3 Replies

7. Solaris

Alter zip file without unzipping

I have some zip files. Every file has a "folder/xml file" inside it. Is there any way to change these zip files directly without unzipping them. I want to convert these zip files to "/xml file" (want to move the xml file/s one root up by removing the folder inside it.) Ex: -bash-3.00$ for file... (1 Reply)
Discussion started by: _prasad
1 Replies

8. UNIX for Dummies Questions & Answers

unzip .zip file and list the files included in the .zip archive

Hello, I am trying to return the name of the resulting file from a .zip archive file using unix unzip command. unzip c07212007.cef7081.zip Archive: c07212007.cef7081.zip SecureZIP for z/OS by PKWARE inflating: CEP/CEM7080/PPVBILL/PASS/G0063V00 I used the following command to unzip in... (5 Replies)
Discussion started by: oracledev
5 Replies

9. Shell Programming and Scripting

How to search a pattern inside a zipped file ie (.gz file) with out unzipping it

How to search a pattern inside a zipped file ie (.gz file) with out unzipping it? using grep command.. Bit urgent.. pls..help me (2 Replies)
Discussion started by: senraj01
2 Replies

10. UNIX for Dummies Questions & Answers

unzipping .zip file on HP and Solaris

I am transferring a large .zip file (20 GB) from an NT server to HP-UX and Solaris servers. Originally I tried to use info-zip's unzip, but I found out pretty quickly that it does not support files over 4GB. Any suggestions on how to work around this problem? Different decompression utility?... (9 Replies)
Discussion started by: dangral
9 Replies
Login or Register to Ask a Question