List only files and not directories in archive
0
votes
1
answer
407
views
I have a zip achieve like below
$ unzip -l 5124.zip
Archive: 5124.zip
Length Date Time Name
--------- ---------- ----- ----
0 01-13-2021 09:22 u/
0 01-13-2021 09:22 u/MyCom/
0 01-13-2021 09:22 u/MyCom/UNX/
0 01-13-2021 09:22 u/MyCom/UNX/scripts/
0 01-13-2021 09:22 u/MyCom/UNX/scripts/SYNC/
0 01-13-2021 09:22 u/MyCom/UNX/scripts/SYNC/sql/
48704 01-13-2021 01:50 u/MyCom/UNX/scripts/SYNC/sql/Load.sql
41872 01-13-2021 01:00 u/MyCom/UNX/scripts/SYNC/sql/Update1.sql
--------- -------
90576 8 files
I want to just get the filenames in the archive while ignoring the rest which in the above case is
/u/MyCom/UNX/scripts/SYNC/sql/Load.sql
/u/MyCom/UNX/scripts/SYNC/sql/Update1.sql
Note: The preceding
/
is missing from the output of unzip
this I need
/u/MyCom/UNX/scripts/SYNC/sql/Load.sql
/u/MyCom/UNX/scripts/SYNC/sql/Update1.sql
and not
u/MyCom/UNX/scripts/SYNC/sql/Load.sql
u/MyCom/UNX/scripts/SYNC/sql/Update1.sql
Any good way to get this info from any given zip ?
Asked by Ashar
(527 rep)
Jan 19, 2021, 06:52 PM
Last activity: Jan 19, 2021, 07:51 PM
Last activity: Jan 19, 2021, 07:51 PM