Sponsored Content
Full Discussion: Unzip a gz file
Top Forums Shell Programming and Scripting Unzip a gz file Post 302984955 by Don Cragun on Thursday 3rd of November 2016 12:41:42 AM
Old 11-03-2016
Quote:
Originally Posted by pranabpal
creating a back up is not the solution. need the command to perform the action unziping the gz file and keep the gz file intact.
You said you want to keep the gz file intact. You haven't told us what operating system you're using, so we have no way of guessing if the gunzip utility on your system has an option that keeps it from removing the gz file after in extracts all of the contained in that archive. But, versions of the gunzip utility that I use ALWAYS remove the archive when they're done. itkamaraj made a suggestion that might or might not work for you (depending on whether the pathnames used when creating the archive were absolute or relative).

If you're unwilling to make a copy of the archive before unzipping it, you can't keep the archive unless you would like to supply yourself with a version of gunzip that behaves differently from the versions I use.

Feel free to try itkamaraj's suggestion or not; but, please do not fault itkamaraj for trying to do what you requested.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

How to unzip a .zip file when

there is no unzip package present. (2 Replies)
Discussion started by: yogesh_powar
2 Replies

2. HP-UX

How to Unzip a .ZIP file in Unix without using unzip cmd..?????

Hi All I have ftped a .ZIP file (zipped using WinZip in Windows) to my Unix server (HP-UX). I don't have unzip cmd available in my curent Unix version Please let me know any cmd in UNIX (other than unzip) using which I can unzip this .ZIP file . Please elaborate on the commands aval and... (5 Replies)
Discussion started by: sureshg_sampat
5 Replies

3. Solaris

how to unzip File which has no extension

Hi experts, I have files as you see which is in gzip format. How can i uncompress it using gunzip/gzip/uncompress?? The file has NO extension. Do i need to rename the file as *.Z /or other and then unzip the file. bash-2.05$ file Files029999200711101618 Files029999200711101618: gzip... (13 Replies)
Discussion started by: thepurple
13 Replies

4. Shell Programming and Scripting

How to Unzip a .ZIP file in Unix without using unzip cmd..?????

Hi All I have ftped a .ZIP file (zipped using WinZip in Windows) to my Unix server (HP-UX). I don't have unzip cmd available in my curent Unix version Please let me know any cmd in UNIX (other than unzip) using which I can unzip this .ZIP file . Please elaborate on the commands aval and... (5 Replies)
Discussion started by: sureshg_sampat
5 Replies

5. Shell Programming and Scripting

How to unzip the file

Hi, I have a file in the form of .zip in unix directory, now I want to unzip the file in unix environment. May I know how to unzip this file File name: cust.zip Thanks in Advance... Aswice (1 Reply)
Discussion started by: aswice
1 Replies

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

7. UNIX for Dummies Questions & Answers

unzip single file in zip file to STDOUT

Hi, Does anyone know if there is an unzip command similar to tar -xOf $tarBall $fileInTarFile which will untar a single file in a tar ball to STDOUT ? I want to do the same but with a .zip (ZIP archive) file. - Andy ---------- Post updated at 05:56 PM ---------- Previous update... (0 Replies)
Discussion started by: andyatit
0 Replies

8. Shell Programming and Scripting

Unzip the .zip file without using unzip utility in UNIX

I have .zip file, i want to list all the files archived in the zip file. unzip utility is not working for me in unix. Please help me resolve this issue Thanks ganesh. (3 Replies)
Discussion started by: Ganesh L
3 Replies

9. Windows & DOS: Issues & Discussions

Looking for help unzip multiple file

Hi all , My server using backup software and backup software corrupted , unable to restore it perfectly. so i'm need a way to 1 time unzip all file, due to now all my backup file are in zip type. will be sometime like this : M:\path\folder.zip M:\path\folder\subfolder... (5 Replies)
Discussion started by: kttan
5 Replies

10. Solaris

Getting error while trying to unzip the file.

Hello Team, I have written below code to zip the directory and all the files and folder under it, but getting an error whenever I am trying to download the file on windows machine and trying to unzip it. Please help catalogName="catalog";... (4 Replies)
Discussion started by: aks_1902
4 Replies
AR(1)							      General Commands Manual							     AR(1)

NAME
ar - archive and library maintainer SYNOPSIS
ar key [ posname ] afile name ... DESCRIPTION
Ar maintains groups of files combined into a single archive file. Its main use is to create and update library files as used by the loader. It can be used, though, for any similar purpose. Key is one character from the set drqtpmx, optionally concatenated with one or more of vuaibcl. Afile is the archive file. The names are constituent files in the archive file. The meanings of the key characters are: d Delete the named files from the archive file. r Replace the named files in the archive file. If the optional character u is used with r, then only those files with modified dates later than the archive files are replaced. If an optional positioning character from the set abi is used, then the posname argument must be present and specifies that new files are to be placed after (a) or before (b or i) posname. Otherwise new files are placed at the end. q Quickly append the named files to the end of the archive file. Optional positioning characters are invalid. The command does not check whether the added members are already in the archive. Useful only to avoid quadratic behavior when creating a large archive piece-by-piece. t Print a table of contents of the archive file. If no names are given, all files in the archive are tabled. If names are given, only those files are tabled. p Print the named files in the archive. m Move the named files to the end of the archive. If a positioning character is present, then the posname argument must be present and, as in r, specifies where the files are to be moved. x Extract the named files. If no names are given, all files in the archive are extracted. In neither case does x alter the archive file. v Verbose. Under the verbose option, ar gives a file-by-file description of the making of a new archive file from the old archive and the constituent files. When used with t, it gives a long listing of all information about the files. When used with p, it precedes each file with a name. c Create. Normally ar will create afile when it needs to. The create option suppresses the normal message that is produced when afile is created. l Local. Normally ar places its temporary files in the directory /tmp. This option causes them to be placed in the local directory. FILES
/tmp/v* temporaries SEE ALSO
ld(1), ar(5), lorder(1) BUGS
If the same file is mentioned twice in an argument list, it may be put in the archive twice. AR(1)
All times are GMT -4. The time now is 05:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy