Top Forums Shell Programming and Scripting Script to unzip files and Rename the Output-files Post 302875853 by lohith.dutta on Wednesday 20th of November 2013 02:31:56 PM
hope this might help you Smilie

find . -type f -name "*.zip" > /myhome/ZIP/FILE_LIST
cd /myhome/ZIP/
for I in `cat FILE_LIST`
    cp ${I} ${I//\//__}
    gunzip ${I//\//__}

Last edited by Scott; 11-20-2013 at 10:22 PM.. Reason: Code tags - for the 12th time in 17 posts
Test Your Knowledge in Computers #917
Difficulty: Easy
Unix time is also known as Epoch time.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problems writing bash script to unzip files

I'm getting the following errors when I try to write a script to unzip some zip files. When I use the free trial copy of the commerical winzip program, however, they work fine. When I use -l or -t on unzip it indicates no errors. When I use the -o switch interactively from the bash command line it... (1 Reply)
Discussion started by: siegfried
1 Replies

2. Shell Programming and Scripting

unzip particular gzip files among the normal data files

Hello experts, I run Solaris 9. I have a below script which is used for gunzip the thousand files from a directory. ---- #!/usr/bin/sh cd /home/thousands/gzipfiles/ for i in `ls -1` do gunzip -c $i > /path/to/file/$i done ---- In my SAME directory there thousand of GZIP file and also... (4 Replies)
Discussion started by: thepurple
4 Replies

3. Shell Programming and Scripting

Script to unzip specific files

As part of an audit at work I need to review a lot of Windows workstations. One thing I need to do is review all of the .doc files. My problem is that I guessed a number of these files would be in zip archives. This is the case but they are mixed in with a lot of other file types that I am not... (1 Reply)
Discussion started by: stumpyuk
1 Replies

4. UNIX for Dummies Questions & Answers

rename multiple files from search output

Variations of multiple renames seems to come up a lot but i can't find the answer to this situation. Tidying up a directory where people rename files to .working, .bob, .attempt1 & so on. what i am trying to do is: list the file type, & rename from ".whatever" to .fixed. As the ".whatever" is... (5 Replies)
Discussion started by: woodstock
5 Replies

5. Shell Programming and Scripting

Unix Script - Move and Unzip Files

Requirement Details: We have a folder named 'Inbound Files' that has many folders in it containing source files that have to be processed by Informatica system. We have zipped files, text files and csv files in those folders that have to be moved (cut and paste) from 'Inbound_Files' folder to... (3 Replies)
Discussion started by: haralebp
3 Replies

6. Shell Programming and Scripting

How to unzip files from folder in shell script (ksh)?

I have a folder (C:\shellprg\input\) containing .CSV, .zip, .gz files. 1] I want to find all .zip/.gz files from folder (C:\shellprg\input\). 2] unzip/uncompress files into the same folder (C:\shellprg\input\) through shell script. I am using below commands for unzip files, unzip <filename>... (2 Replies)
Discussion started by: Poonamol
2 Replies

7. Shell Programming and Scripting

Batch Script To Unzip and Rename File

Hello All, I need help in writing a batch script. I have 100 zip files in a folder. Each zip file has a unique name starting with Each zip file contains single csv file I would like to batch extract the files and also rename the extracted csv as per the original zip name... (6 Replies)
Discussion started by: rajlakshmi
6 Replies

8. Shell Programming and Scripting

Using Shell Script in place of Perl script to Unzip the zip files.

Hi Expert, We have some shell scripts which Internally uses Perl Script to Unzip the source zip files which comes to inbound directory. So now our requirement is to avoid the dependency on Perl Script and us Shell Script to unzip the files. I have the Perl script with me attached can some one... (3 Replies)
Discussion started by: naveen.dasu
3 Replies

9. 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: 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

10. Shell Programming and Scripting

SBATCH trinity for multiple files and rename/move the output files

Hey guys, I have wrote the following script to apply a module named "trinity" on my files. (it takes two input files and spit a trinity.fasta as output) #!/bin/bash -l #SBATCH -p node #SBATCH -A <projectID> #SBATCH -n 16 #SBATCH -t 7-00:00:00 #SBATCH --mem=128GB #SBATCH --mail-type=ALL... (1 Reply)
Discussion started by: @man
1 Replies
ZIPGREP(1)						      General Commands Manual							ZIPGREP(1)

zipgrep - search files in a ZIP archive for lines matching a pattern SYNOPSIS
zipgrep [egrep_options] pattern file[.zip] [file(s) ...] [-x xfile(s) ...] DESCRIPTION
zipgrep will search files within a ZIP archive for lines matching the given string or pattern. zipgrep is a shell script and requires egrep(1) and unzip(1) to function. Its output is identical to that of egrep(1). ARGUMENTS
pattern The pattern to be located within a ZIP archive. Any string or regular expression accepted by egrep(1) may be used. file[.zip] Path of the ZIP archive. (Wildcard expressions for the ZIP archive name are not supported.) If the literal filename is not found, the suffix .zip is appended. Note that self-extracting ZIP files are supported, as with any other ZIP archive; just specify the .exe suffix (if any) explicitly. [file(s)] An optional list of archive members to be processed, separated by spaces. If no member files are specified, all members of the ZIP archive are searched. Regular expressions (wildcards) may be used to match multiple members: * 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.) [-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, ``zipgrep grumpy foo *.[ch] -x */*'' would search for the string ``grumpy'' in all C source files in the main directory of the ``foo'' archive, but none in any subdirectories. Without the -x option, all C source files in all directories within the zipfile would be searched. OPTIONS
All options prior to the ZIP archive filename are passed to egrep(1). SEE ALSO
egrep(1), unzip(1), zip(1), funzip(1), zipcloak(1), zipinfo(1), zipnote(1), zipsplit(1) URL
The Info-ZIP home page is currently at or . AUTHORS
zipgrep was written by Jean-loup Gailly. Info-ZIP 20 April 2009 ZIPGREP(1)

Featured Tech Videos

All times are GMT -4. The time now is 04:06 AM.
Unix & Linux Forums Content Copyright 1993-2020. All Rights Reserved.
Privacy Policy