Search Results

Search: Posts Made By: ericlim
2,292
Posted By ericlim
Anyone got any suggestion?
Anyone got any suggestion?
2,292
Posted By ericlim
How to append filename to rows in gzip stdout
Assume I have 2 gz files with 2 lines each as below
a.gz
a1,a
a2,a

b.gz
b1,b
b2,b

If I issue
gzip -d -c *.gz
I will get below in the stdout
a1,a
a2,a
b1,b
b2,b

What I need it the...
12,087
Posted By ericlim
Thanks a lot!!! The below gets me the result I...
Thanks a lot!!! The below gets me the result I needed.
tar xvf a.tar | nawk -F"[ ,]" '$2~/Z$/{print $2}' | xargs gzip -d

Code tags for code, please.
12,087
Posted By ericlim
This is the output for tar xvf a.tar # tar xvf...
This is the output for tar xvf a.tar
# tar xvf a.tar
x RET20120101.dat.Z, 939194 bytes, 1835 media blocks.
x RET20120102.dat.Z, 939194 bytes, 1835 media blocks.

If I do below, there is no...
12,087
Posted By ericlim
This "almost" works. But somehow there is a .gz...
This "almost" works. But somehow there is a .gz appended to the file name which makes it fail. How to tweak it?
======================================
# tar xvf a.tar | xargs gzip -d
x.gz: No...
12,087
Posted By ericlim
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...
Showing results 1 to 6 of 6

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