All Questions
Tagged with gzip command-line
19 questions
3
votes
2
answers
1k
views
gunzip multiple gz files with same compressed file name in multiple folders
I have a directory where there are multiple folders, each folder contains multiple .gz files with the same zipped file name "spark.log". How can I unzip all of them at once and rename them ...
2
votes
3
answers
19k
views
Creating a tar.gz archive of multiple directories of different locations -- "tar: Cowardly refusing to create an empty archive"
I'm trying to create an achive:
$ cd /tmp
$ tar -czf test1.tar.gz -C ~/Downloads/dir1 -C ~/Documents/dir2 -C ~/dir3/dir4/dir5
... which is supposed not to preserve the full path of the directories in ...
0
votes
1
answer
200
views
How to zgrep and then gzip multiple files individually?
I have the following code which searches for a term in multiple files (file1.json.gz, file2.json.gz, etc etc) using zgrep, and then using gzip it saves the output into a single file:
zgrep -i 'help' /...
0
votes
0
answers
360
views
zgrep with large pattern file
I do not know a lot about the underlying process that grep goes through and I am searching with a long pattern (863 members) in a large file 646.1 MB (zipped) and it is taking some time. I thought ...
14
votes
5
answers
5k
views
Is gzip atomic?
Is gzip atomic?
What happens if I stop the gzip process while it's in the middle of gzipping a file?
If it's not atomic, and if I already pressed Ctrl+C on a gzip *.txt process, how do I safely ...
5
votes
4
answers
30k
views
Sed for gzip files
I have a bunch of gz files and unzipped version of them contains the patterns A and B=1 (these are certainly on different lines where A appears first).
I want to write a command that gives me the ...
1
vote
2
answers
20k
views
gunzip multiple files
I have a directory where there are multiple folders, each of folder contains a .gz file.
How can I unzip all of them at once?
My data looks like this
List of folders
A
B
C
D
In every of them there ...
23
votes
3
answers
59k
views
pv (progress bar) and gzip
Why is this not possible?
pv ${dest_file} | gzip -1
pv is a progress bar
error
gzip: compressed data not written to a terminal. Use -f to force compression.
For help, type: gzip -h
0 B 0:00:00 [ ...
1
vote
1
answer
765
views
Thunar custom action: Extraction to subdirectories
I am attempting to create a Custom Action in Thunar (File Manager) that will extract a gzip archive into a subdirectory of the same name (e.g. abc.tar.gz to abc/). I created this command, which works, ...
0
votes
2
answers
131
views
Wrong zip command messed up my project directory
I've issued a command gzip -r project.zip project/* in projects home directory and I've messed things up; every file in project directory and all other subdirectories have .gz extension. How do I undo ...
31
votes
5
answers
51k
views
How do I compress files in-place?
I have a machine with 90% hard-disk usage. I want to compress its 500+ log files into a smaller new file. However, the hard disk is too small to keep both the original files and the compressed ones.
...
13
votes
1
answer
16k
views
Estimate the size of the extracted files before extraction a `tar.gz` archive?
Before using tar to extract a .tar.gz archive, it is possible to get an estimate of how large the extracted files are in total?
4
votes
1
answer
2k
views
How to create a deterministic tar.gz using git-archive?
Creating a git repository for testing.
~ $ mkdir somefolder
~ $ cd somefolder/
~/somefolder $ git init
Initialized empty Git repository in /home/user/somefolder/.git/
~/somefolder $ echo test > ...
253
votes
2
answers
913k
views
Unzipping a .gz file without removing the gzipped file [duplicate]
I have a file file.gz, when I try to unzip this file by using gunzip file.gz, it unzipped the file but only contains extracted and removes the file.gz file.
How can I unzip by keeping both unzipped ...
2
votes
3
answers
17k
views
How do you view a sql.gz file as plain text SQL from the command line?
How do you view a sql.gz file as plain text SQL from the command line?
I want to read the SQL statements stored in a .sql.gz file, from the command line on the server. I've tried tar -xzvf, but get ...