Sponsored Content
Top Forums Shell Programming and Scripting unzip particular gzip files among the normal data files Post 302148240 by thepurple on Friday 30th of November 2007 10:17:49 AM
Old 11-30-2007
hi guys,

Below is worked for me. Thanks buddies for the hints--
#!/usr/bin/sh
cd /thousand/files/
for i in `ls`
do
l=`file $i|grep gzip|wc -l`

if [ $l -ne 0 ]; then
gunzip -c $i > /path/to/file/$i
fi
done
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Normal user access to files/folders

I was wondering if there is a way to give my regular user on Linux right to the /var/www/html folder and files therin without going into SU mode every time. Thanks. Gregg (1 Reply)
Discussion started by: gdboling
1 Replies

2. Shell Programming and Scripting

How redirect output(error and normal) to 2 different files

Hello, I have a java program which i am calling in shell script. I wanted to redirect output to 2 differetn files. Output should have both 1 & 2 (normal and error) in both file. pls help (2 Replies)
Discussion started by: balareddy
2 Replies

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

4. UNIX for Advanced & Expert Users

how to unzip files in different directories

Hi there: Is there any fest way to upzip files that distributed in several directories and their sub-directory instead of unzipping them directory by directory?? Thanks a lot!!! (1 Reply)
Discussion started by: cls3415
1 Replies

5. Shell Programming and Scripting

Unzip .tla files

Hi , I have a file which is with extension .tla. I have no idea what file it is so can anybody let me know what it is?. Regards, Chetan.C (1 Reply)
Discussion started by: chetan.c
1 Replies

6. Shell Programming and Scripting

unzip selected files

Hi, In file zip folder i have many files but i want to extract onlu .LOG file from the zip. How can i achive this Rajesh (3 Replies)
Discussion started by: guddu_12
3 Replies

7. UNIX for Dummies Questions & Answers

Unzip the Files

I have a list of zip files and regular files in a folder /home/data/ Example: PMExtra_A123_ABC_121001020000.zip PMExtra_B596_GRT_121001020000.zip PMExtra_C156_SFD_121001020000.zip PMExtra_S243_KDF_121001020000.xml PMExtra_L234_IDF_121001020000.xml I have to unzip all the .zip... (8 Replies)
Discussion started by: eskay
8 Replies

8. AIX

Moving Hidden files to normal files

I have a bunch of hidden files in a directory in AIX. I would like to move these hidden files as regular files to another directory. Say i have the following files in directory /x .test~1234~567 .report~5678~123 .find~9876~576 i would like to move them to directory /y as test~1234~567... (10 Replies)
Discussion started by: umesh.narain
10 Replies

9. Shell Programming and Scripting

Script to unzip files and Rename the Output-files

Hi all, I have a many folders with zipped files in them. The zipped files are txt files from different folders. The txt files have the same names. If i try to find . -type f -name "*.zip" -exec cp -R {} /myhome/ZIP \; it fails since the ZIP files from different folders have the same names and... (2 Replies)
Discussion started by: pmkenya
2 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
XZGREP(1)							     XZ Utils								 XZGREP(1)

NAME
xzgrep - search compressed files for a regular expression SYNOPSIS
xzgrep [grep_options] [-e] pattern file... xzegrep ... xzfgrep ... lzgrep ... lzegrep ... lzfgrep ... DESCRIPTION
xzgrep invokes grep(1) on files which may be either uncompressed or compressed with xz(1), lzma(1), gzip(1), or bzip2(1). All options specified are passed directly to grep(1). If no file is specified, then the standard input is decompressed if necessary and fed to grep(1). When reading from standard input, gzip(1) and bzip2(1) compressed files are not supported. If xzgrep is invoked as xzegrep or xzfgrep then egrep(1) or fgrep(1) is used instead of grep(1). The same applies to names lzgrep, lze- grep, and lzfgrep, which are provided for backward compatibility with LZMA Utils. ENVIRONMENT
GREP If the GREP environment variable is set, xzgrep uses it instead of grep(1), egrep(1), or fgrep(1). SEE ALSO
grep(1), xz(1), gzip(1), bzip2(1), zgrep(1) Tukaani 2009-07-05 XZGREP(1)
All times are GMT -4. The time now is 08:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy