Sponsored Content
Top Forums Shell Programming and Scripting Extract a list of files using unzip command Post 302895390 by Corona688 on Monday 31st of March 2014 03:20:36 PM
Old 03-31-2014
From man unzip:

Code:
       -n     never overwrite existing files.  If a file already exists,  skip
              the extraction of that file without prompting.  By default unzip
              queries before extracting any file that already exists; the user
              may  choose  to  overwrite  only the current file, overwrite all
              files, skip extraction of the current file, skip  extraction  of
              all existing files, or rename the current file.

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

how to unzip and extract tar file in single command

In order to save diskspace and avoid of disk full during unzip then extract the tar file is there any tar unzip command would unzip and extract tar at the same time (test123.tar.gz) thank in advance (6 Replies)
Discussion started by: darkrainbow
6 Replies

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

3. Shell Programming and Scripting

Shell script or command help to extract specific contents from a long list of content

Hi, I got a long list of contents: >sequence_1 ASSSSSSSSSSSDDDDDDDDDDDCCCCCCC ASDSFDFFDFDFFWERERERERFSDFESFSFD >sequence_2 ASDFDFDFFDDFFDFDSFDSFDFSDFSDFDSFASDSADSADASD ASDFFDFDFASFASFASFAFSFFSDASFASFASFAFS >sequence_3 VEDFGSDGSDGSDGSDGSDGSDGSDG dDFSDFSDFSDFSDFSDFSDFSDFSDF... (2 Replies)
Discussion started by: patrick87
2 Replies

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

5. Solaris

Command to list or view the files in .pkg (solaris) and how to extract without installing

In Linux for .rpm we can list or view the files using the command rpm -qpl <file.rpm> and to extract, the command is rpm2cpio <file.rpm> | cpio -idvh I would like to know the commands which has same functionality as above for solaris ( .pkg) Thanks in Advance (5 Replies)
Discussion started by: frintocf
5 Replies

6. Shell Programming and Scripting

Single command - unzip files from a tar command

I have a tar file that contains multiple .Z files. Hence I need to issue a tar command followed by a gzip command to fully extract the files. How do I do it in a single command? What I'm doing now is tar xvf a.tar (this will output 1.Z and 2.Z) gzip -d *.Z (to extract 1.Z and 2.Z) (9 Replies)
Discussion started by: ericlim
9 Replies

7. Shell Programming and Scripting

Extract few content from a huge list of files

I have a huge list of files (about 300,000) which have a pattern like this. .I 1 .U 87049087 .S Am J Emerg .M Allied Health Personnel/*; Electric Countershock/*; .T Refibrillation managed by EMT-Ds: .P ARTICLE. .W Some patients converted from ventricular fibrillation to organized... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies

8. UNIX for Dummies Questions & Answers

Extract .zip file without using unzip,tar

Hi, Need to extract a file containing multiple .txt files without using tar/unzip as they are not available (1 Reply)
Discussion started by: santoshdrkr
1 Replies

9. UNIX for Dummies Questions & Answers

7z command for files larger than 4GB ( unzip doesn't work)

My unzip command doesn't work for files that are greater than 4GB. Consider my file name is unzip -p -a filename.zip, the command doesn't work since the size of the file is larger. I need to know the corresponding 7z command for the same. This is my Unix shell script program: if then ... (14 Replies)
Discussion started by: chandraprakash
14 Replies

10. Shell Programming and Scripting

Unzip all the files with subdirectories present and append a part of string from the main .zip files

Hi frnds, My requirement is I have a zip file with name say eg: test_ABC_UH_ccde2a_awdeaea_20150422.zip within that there are subdirectories on each directory we again have .zip files and in that we have files like mama20150422.gz and so on. Iam in need of a bash script so that it unzips... (0 Replies)
Discussion started by: Ravi Kishore
0 Replies
UNZIPSFX(1)						      General Commands Manual						       UNZIPSFX(1)

NAME
unzipsfx - self-extracting stub for prepending to ZIP archives SYNOPSIS
<name of unzipsfx+archive combo> [-cfptuz[ajnoqsCLV$]] [file(s) ... [-x xfile(s) ...]] DESCRIPTION
unzipsfx is a modified version of unzip(1) designed to be prepended to existing ZIP archives in order to form self-extracting archives. Instead of taking its first non-flag argument to be the zipfile(s) to be extracted, unzipsfx seeks itself under the name by which it was invoked and tests or extracts the contents of the appended archive. Because the executable stub adds bulk to the archive (the whole pur- pose of which is to be as small as possible), a number of the less-vital capabilities in regular unzip have been removed. Among these are the usage (or help) screen, the listing and diagnostic functions (-l and -v), the ability to decompress older compression formats (the ``reduce,'' ``shrink'' and ``implode'' methods). The ability to extract to a directory other than the current one can be selected as a compile-time option, which is now enabled by default since UnZipSFX version 5.5. Similarly, decryption is supported as a compile-time option but should be avoided unless the attached archive contains encrypted files. Starting with release 5.5, another compile-time option adds a simple ``run command after extraction'' feature. This feature is currently incompatible with the ``extract to different directory'' feature and remains disabled by default. Note that self-extracting archives made with unzipsfx are no more (or less) portable across different operating systems than is the unzip executable itself. In general a self-extracting archive made on a particular Unix system, for example, will only self-extract under the same flavor of Unix. Regular unzip may still be used to extract the embedded archive as with any normal zipfile, although it will generate a harmless warning about extra bytes at the beginning of the zipfile. Despite this, however, the self-extracting archive is technically not a valid ZIP archive, and PKUNZIP may be unable to test or extract it. This limitation is due to the simplistic manner in which the ar- chive is created; the internal directory structure is not updated to reflect the extra bytes prepended to the original zipfile. ARGUMENTS
[file(s)] An optional list of archive members to be processed. Regular expressions (wildcards) similar to those in Unix egrep(1) may be used to match multiple members. These wildcards may contain: * matches a sequence of 0 or more characters ? matches exactly 1 character [...] matches any single character found inside the brackets; ranges are specified by a beginning character, a hyphen, and an end- ing character. If an exclamation point or a caret (`!' or `^') follows the left bracket, then the range of characters within the brackets is complemented (that is, anything except the characters inside the brackets is considered a match). (Be sure to quote any character that might otherwise be interpreted or modified by the operating system, particularly under Unix and VMS.) [-x xfile(s)] An optional list of archive members to be excluded from processing. Since wildcard characters match directory separators (`/'), this option may be used to exclude any files that are in subdirectories. For example, ``foosfx *.[ch] -x */*'' would extract all C source files in the main directory, but none in any subdirectories. Without the -x option, all C source files in all directories within the zipfile would be extracted. If unzipsfx is compiled with SFX_EXDIR defined, the following option is also enabled: [-d exdir] An optional directory to which to extract files. By default, all files and subdirectories are recreated in the current directory; the -d option allows extraction in an arbitrary directory (always assuming one has permission to write to the directory). The option and directory may be concatenated without any white space between them, but note that this may cause normal shell behavior to be suppressed. In particular, ``-d ~'' (tilde) is expanded by Unix C shells into the name of the user's home directory, but ``-d~'' is treated as a literal subdirectory ``~'' of the current directory. OPTIONS
unzipsfx supports the following unzip(1) options: -c and -p (extract to standard output/screen), -f and -u (freshen and update existing files upon extraction), -t (test archive) and -z (print archive comment). All normal listing options (-l, -v and -Z) have been removed, but the testing option (-t) may be used as a ``poor man's'' listing. Alternatively, those creating self-extracting archives may wish to include a short listing in the zipfile comment. See unzip(1) for a more complete description of these options. MODIFIERS
unzipsfx currently supports all unzip(1) modifiers: -a (convert text files), -n (never overwrite), -o (overwrite without prompting), -q (operate quietly), -C (match names case-insensitively), -L (convert uppercase-OS names to lowercase), -j (junk paths) and -V (retain ver- sion numbers); plus the following operating-system specific options: -X (restore VMS owner/protection info), -s (convert spaces in file- names to underscores [DOS, OS/2, NT]) and -$ (restore volume label [DOS, OS/2, NT, Amiga]). (Support for regular ASCII text-conversion may be removed in future versions, since it is simple enough for the archive's creator to ensure that text files have the appropriate format for the local OS. EBCDIC conversion will of course continue to be supported since the zipfile format implies ASCII storage of text files.) See unzip(1) for a more complete description of these modifiers. ENVIRONMENT OPTIONS
unzipsfx uses the same environment variables as unzip(1) does, although this is likely to be an issue only for the person creating and testing the self-extracting archive. See unzip(1) for details. DECRYPTION
Decryption is supported exactly as in unzip(1); that is, interactively with a non-echoing prompt for the password(s). See unzip(1) for details. Once again, note that if the archive has no encrypted files there is no reason to use a version of unzipsfx with decryption sup- port; that only adds to the size of the archive. AUTORUN COMMAND
When unzipsfx was compiled with CHEAP_SFX_AUTORUN defined, a simple ``command autorun'' feature is supported. You may enter a command into the Zip archive comment, using the following format: $AUTORUN$>[command line string] When unzipsfx recognizes the ``$AUTORUN$>'' token at the beginning of the Zip archive comment, the remainder of the first line of the com- ment (until the first newline character) is passed as a shell command to the operating system using the C rtl ``system'' function. Before executing the command, unzipsfx displays the command on the console and prompts the user for confirmation. When the user has switched off prompting by specifying the -q option, autorun commands are never executed. In case the archive comment contains additional lines of text, the remainder of the archive comment following the first line is displayed normally, unless quiet operation was requested by supplying a -q option. EXAMPLES
To create a self-extracting archive letters from a regular zipfile letters.zip and change the new archive's permissions to be world-exe- cutable under Unix: cat unzipsfx letters.zip > letters chmod 755 letters zip -A letters To create the same archive under MS-DOS, OS/2 or NT (note the use of the /b [binary] option to the copy command): copy /b unzipsfx.exe+letters.zip letters.exe zip -A letters.exe Under VMS: copy unzipsfx.exe,letters.zip letters.exe letters == "$currentdisk:[currentdir]letters.exe" zip -A letters.exe (The VMS append command may also be used. The second command installs the new program as a ``foreign command'' capable of taking argu- ments. The third line assumes that Zip is already installed as a foreign command.) Under AmigaDOS: MakeSFX letters letters.zip UnZipSFX (MakeSFX is included with the UnZip source distribution and with Amiga binary distributions. ``zip -A'' doesn't work on Amiga self- extracting archives.) To test (or list) the newly created self-extracting archive: letters -t To test letters quietly, printing only a summary message indicating whether the archive is OK or not: letters -tqq To extract the complete contents into the current directory, recreating all files and subdirectories as necessary: letters To extract all *.txt files (in Unix quote the `*'): letters *.txt To extract everything except the *.txt files: letters -x *.txt To extract only the README file to standard output (the screen): letters -c README To print only the zipfile comment: letters -z LIMITATIONS
The principle and fundamental limitation of unzipsfx is that it is not portable across architectures or operating systems, and therefore neither are the resulting archives. For some architectures there is limited portability, however (e.g., between some flavors of Intel- based Unix). Another problem with the current implementation is that any archive with ``junk'' prepended to the beginning technically is no longer a zipfile (unless zip(1) is used to adjust the zipfile offsets appropriately, as noted above). unzip(1) takes note of the prepended bytes and ignores them since some file-transfer protocols, notably MacBinary, are also known to prepend junk. But PKWARE's archiver suite may not be able to deal with the modified archive unless its offsets have been adjusted. unzipsfx has no knowledge of the user's PATH, so in general an archive must either be in the current directory when it is invoked, or else a full or relative path must be given. If a user attempts to extract the archive from a directory in the PATH other than the current one, unzipsfx will print a warning to the effect, ``can't find myself.'' This is always true under Unix and may be true in some cases under MS- DOS, depending on the compiler used (Microsoft C fully qualifies the program name, but other compilers may not). Under OS/2 and NT there are operating-system calls available that provide the full path name, so the archive may be invoked from anywhere in the user's path. The situation is not known for AmigaDOS, Atari TOS, MacOS, etc. As noted above, a number of the normal unzip(1) functions have been removed in order to make unzipsfx smaller: usage and diagnostic info, listing functions and extraction to other directories. Also, only stored and deflated files are supported. The latter limitation is mainly relevant to those who create SFX archives, however. VMS users must know how to set up self-extracting archives as foreign commands in order to use any of unzipsfx's options. This is not nec- essary for simple extraction, but the command to do so then becomes, e.g., ``run letters'' (to continue the examples given above). unzipsfx on the Amiga requires the use of a special program, MakeSFX, in order to create working self-extracting archives; simple concate- nation does not work. (For technically oriented users, the attached archive is defined as a ``debug hunk.'') There may be compatibility problems between the ROM levels of older Amigas and newer ones. All current bugs in unzip(1) exist in unzipsfx as well. DIAGNOSTICS
unzipsfx's exit status (error level) is identical to that of unzip(1); see the corresponding man page. SEE ALSO
funzip(1), unzip(1), zip(1), zipcloak(1), zipgrep(1), zipinfo(1), zipnote(1), zipsplit(1) URL
The Info-ZIP home page is currently at http://www.info-zip.org/pub/infozip/ or ftp://ftp.info-zip.org/pub/infozip/ . AUTHORS
Greg Roelofs was responsible for the basic modifications to UnZip necessary to create UnZipSFX. See unzip(1) for the current list of Zip- Bugs authors, or the file CONTRIBS in the UnZip source distribution for the full list of Info-ZIP contributors. Info-ZIP 20 April 2009 (v6.0) UNZIPSFX(1)
All times are GMT -4. The time now is 06:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy