Questions tagged [compression]

Shrinking (compressing) and restoring (decompressing) of data.

Filter by
Sorted by
Tagged with
2 votes
1 answer
32 views

How do I view contents of initramfs.img in Debian-based distributions?

I often have open questions regarding the booting of a machine with GNU/Linux installed. In such cases, it could be helpful to view which files are present in the initramfs image. I have googled for a ...
0 votes
0 answers
21 views

How to mount a compressed file for random reading? [duplicate]

I have a large disk image that I don't need to access now, but I might in the future. I'd like to compress it, but without needing to fully decompress it to read it. If I compress it with an algorithm ...
  • 111
0 votes
2 answers
40 views

How to use jpegoptim to have files only 20kb in size?

I have tried using jpegoptim and even tried the manpage but am stumped. Here is a file I want to reduce to 50k and even open to reducing quality of the data - Image: Filename: shirish.jpg Format: ...
  • 11.2k
-5 votes
1 answer
53 views

Why are zips still used even when kernels compress files by default?

Why aren't .zips obsolete, now that most, if not all, modern kernels support on-the-fly compression?
1 vote
1 answer
31 views

How to extract all uncorrupted file from bzip2 compression?

I am trying to uncompresss a bzip2 file (~55 GB) with the command tar -jxvf file.tar.bz2 However I found that the decompression process gets stuck at a certain file and, after waiting a long duration, ...
-1 votes
1 answer
84 views

How do I extract a .tar.xz file? [duplicate]

Some software seems to be distributed in a new archive format: $ file node-v18.7.0-linux-x64.tar.xz node-v18.7.0-linux-x64.tar.xz: XZ compressed data How do I extract this, preferably using tar (like ...
  • 1,637
1 vote
0 answers
39 views

Compressing small files with gzip makes its size smaller than with bzip2, why? [closed]

I have a question, just a little thing couch my eyes it's about compression with gzip and bzip2: If I understood correctly - bzip2 requires more processing power but compresses files smaller and more ...
  • 11
1 vote
1 answer
81 views

Looking for a linux backup tool multithreaded with encryption and good compression algorithm

I am looking for a linux backup tool to upgrade my backup strategy. Today I do full backups everyday on Linux server (Ubuntu 20.04). I prefer to backup data directly inside our VMs and send to another ...
1 vote
1 answer
39 views

Why GZIP utility cares about extension?

Whenever I need to decompress a file which was compressed with Gzip, I need to rename the file with a .gz extension , I tried other compression utility like zip, bzip2 and they don't seem to care ...
  • 13
1 vote
1 answer
53 views

Are there any compression algorithms that create identical files on Linux and Mac?

This question and answer (GZip doesn't produce the same compressed result on macOS vs Linux) are pretty clearly the GZIP doesn't meet the bill. No argument there. But, I think the real question ...
0 votes
0 answers
226 views

Unable to decompress gzip file ("not in gzip format")

I've been tasked with diagnosing an issue with a webpage, and I've been able to trace the issue back to a gzip'ed JavaScript file, jquery.min.js.gz. To view the code, I've downloaded and attempted to ...
0 votes
1 answer
181 views

CLI tool that compress the given image, whatever file type the image is (png, jpg, gif, webp, svg)?

I know that there are many tools to optimize an image: pngquant optipng jpegoptim gifsicle exiftool ecc but they are all specific for a certain file type. Is there a single command line that, ...
  • 215
0 votes
1 answer
494 views

Create a tar.gz file from a different directory, tar must keep files in specific directory structure

Here is my file structure. I am currently residing in test2/ directory, and all commands must run from there. test/ |_test2/ publish/ |_subfolder1/ |_f1 |_f2 |_f3 |...
  • 428
1 vote
0 answers
132 views

Alternatives to compressed tarballs

I am reading/writing data from/to tapes using Debian and recently ran into an issue where I needed to figure out the size of the stored data stream, i.e. the data actually written to the tape (see ...
2 votes
1 answer
143 views

Read file size from tape

I have a tape with a .tar.lzma archive written to it. How can I determine the size of the .tar.lzma archived as is? In other words, I'm looking to find the size of the compressed archive, not the size ...
0 votes
2 answers
134 views

Compress several files according to the pattern

I would like to know how to compress several files according to the pattern using gzip, tar, etc... that is, if I have these files: server_regTCA.log.2021.02.12 server_regTCA.log.2021.02.13 ...
0 votes
2 answers
125 views

Why initrd size is not fixed?

After update-initramfs -c -k KERNELVERSION(I didn't do any change and just type this command), the initrd will always has different size with the previous initrd. And this situation happen on Debian ...
  • 21
1 vote
1 answer
103 views

How to compress stdout without block buffering

I tryed this myprogram | gzip > /var/log/mylog.log In my understanding this will write to log file only when a whole gzip block is produced, which I think is 32kB. This introduces considerable lag ...
  • 133
18 votes
2 answers
2k views

How do I uncompress a file with lots of zeroes as a sparse file?

I have a compressed raw image of a very large hard drive created using cat /dev/sdx | xz > image.xz. However, the free space in the drive was zeroed before this operation, and the image consists ...
-1 votes
1 answer
204 views

Pick random line from a compressed text file with zcat/gz or altnernatives

I have a simple bash script that picks a random line from a text file. This is originally done with shuf file.txt | head -1 (the same result can be achieved with cat file.txt | shuf | head -1). I also ...
3 votes
1 answer
224 views

Reduce the filesize of a PDF with text?

I have a PDF created with PDF Sandwich. Each page of the PDF contains a background image and some foreground text. I want to reduce the filesize (not the resolution) of the background image - and ...
4 votes
2 answers
566 views

Unable to choose compress program

I can't choose the compress program while using tar v1.26. While this works tar -c -I 'xz' -f foo.tar.xz * This won't work: tar -c -I 'xz -T0' -f foo.tar.xz * tar (child): xz -T0: Cannot exec: No ...
0 votes
2 answers
67 views

Archive folder onto server, compress on the host

I try to do the following: Upload a folder (say Pictures) onto a server Let the server compress the input stream and save it to a file Importantly, step 1) should be uncompressed as the connection ...
0 votes
0 answers
48 views

tar compress only if source files updated

I am implementing a process in which a tar.gz file is created that compresses various files needed from the process. When this compression is done I don't want it to be compressed again, or crush the ...
  • 101
0 votes
0 answers
100 views

How to make mksquashfs with parameters

I have read Squashfs filesystem , when I look on this file with binwalk or with file I saw: Squashfs filesystem, little endian, version 4.0, compression:xz, size: 1233455 bytes, 112 inodes, blocksize:...
2 votes
0 answers
207 views

Compare zip file and extracted directory

What is the simplest way to compare a zip file and a directory that has been extracted from the zip file? I would like to delete the zip file if they are the same. Example. Need to check if Archive....
  • 121
2 votes
3 answers
369 views

tar list full filename without directory

I have a tgz file with the following file structure - folder - subdir1 - file1.txt - file2.text - subdir2 - file1.txt When i run tar -tf folder.tgz, it outputs the following:...
0 votes
1 answer
92 views

Exclude directory from tar

I try to compress my wordpress directory /srv/www/vhost/wp-intranet. But I need to exclude the directory /srv/www/vhost/wp-intranet/wp-content/uploads/ First I changed directory to /srv/www/vhost/ ...
  • 1,771
0 votes
0 answers
25 views

Is modifying a database on compressed ZFS slow?

Is modifying (mainly inserting new rows into tables with many indexes) a (PostgreSQL) database on a compressed ZFS slow (compared to an uncompressed ZFS)? I used a slow HDD backed by SSDs. Ubuntu ...
  • 2,056
0 votes
2 answers
46 views

Tool to detect and give info of compression method

What is utility tool to detect and give info of compression method (preferably more info) in any mean (CL or GUI) ? IOW what windows 7z tool equivalent for Linux, giving info easily in GUI?
0 votes
1 answer
114 views

Create set of fixed sized compressed files from a large number of files

I have set of large number of files to be archived in a linux server. I need to compress those files in to set of 1GB compressed files. I am using gzip to compress the files but I don't know the final ...
  • 101
2 votes
1 answer
571 views

7z command to create a XZ file

The man page says 7z tool supports 7z, LZMA2, XZ, ZIP, Zip64, CAB, RAR, ARJ, GZIP, BZIP2, TAR, CPIO, RPM, ISO, most filesystem images and DEB formats. And it says we could pass the type as -t{Type}. ...
1 vote
1 answer
494 views

Does Ubuntu support working with compressed Windows files?

In Windows 10 pro, there is an option "Compress this drive to save disk space". If I were to enable that option, will Ubuntu be able to open the files like normal? And is there any side ...
2 votes
1 answer
1k views

How to increase the compression level of SSH tunnels

This is how I establish an SSH tunnel (dynamic port forwarding using SOCKS) from a local computer to a remote computer: ssh -C -N -D 12345 user@192.168.1.2 I use compression (-C) because my bandwidth ...
  • 2,124
1 vote
1 answer
1k views

How to tell if btrfs subvolumes are actually compressed or not

I have mounted Btrfs subvolumes (including /home) with the compress=no option in /etc/fstab. However, when I run btrfs inspect-internal dump-super -a <device_name> (both, on the running system, ...
0 votes
1 answer
186 views

Mounting zip files (plural)

I know I can mount a single zip file as a directory for read-only access (Mount zip file as a read-only filesystem) but if I have a directory (or a directory tree) containing many zip files, is there ...
  • 595
6 votes
1 answer
376 views

How does the ent program calculate "optimum compression"?

The ent program can be run on a file to give output such as the following: Entropy = 4.731183 bits per byte. Optimum compression would reduce the size of this 15731 byte file by 40 percent. Chi ...
  • 1,335
0 votes
1 answer
865 views

can't uncompress a gzip compressed data

I have extracted a file 'linux' from ubutu installation .iso file. The command file linux gives me this output. linux: gzip compressed data, was "vmlinuz-5.4.0-42-generic.efi.signed", last ...
  • 305
3 votes
1 answer
238 views

How can I enable transparent compression on exisitng f2fs partition?

As far as I know it is possible to enable on new partition. Is there any way to enable compression on existing f2fs partition? I don't want to wipe and create a new partition to enable this feature.
0 votes
1 answer
157 views

Extract .tar.gz inside a .tar file

I have a double-compressed file (.tar.gz inside a .tar) and i would like to know if there is any way to automatically extract it from a bash script. I tried two approaches: tar -xf $1 #the first .tar ...
3 votes
1 answer
901 views

Does mounting squashfs put the whole filesystem in RAM?

Situation: I've got a larger (>10GB) read-only collection of small files with loads of duplicates that I need to have available on multiple machines, even on different file systems. We can assume ...
0 votes
1 answer
60 views

What are the file specifications of a compress .Z file?

For some reason, I am unable to find what the specifications are for a .Z file even though I see many things supporting it. Why is it so hard to find online? I am very familiar with LZW compression ...
1 vote
2 answers
111 views

Uncompressed files by content double gzipped by mistake

I have some files that I gzipped twice by mistake with no file extension For example gzip -dc file outputs some binary gibberish for some of the files and for some other files it's okay I would like ...
  • 111
5 votes
2 answers
6k views

How can I extract a RAR file on Debian?

I've got a 20GB RAR file to extract with a password on Debian Linux Google Cloud VM. I first tried sudo apt-get install unrar but the following output was given: Reading package lists... Done Building ...
0 votes
1 answer
191 views

Tool/library to compress/decompress on the fly

I am looking for library or linux command line tool that allows to compress and decompress on the fly. By 'on the fly' I mean something that will work with following sh script: > while:; do; echo &...
  • 103
3 votes
0 answers
608 views

How to prevent btrfs compressing /var

I just installed new instance of Fedora 33 and enabled compression for my root volume via compress=zstd:3 mount option. I enabled compression of /usr with chattr +x /usr. I would like to disable ...
  • 1,922
0 votes
1 answer
122 views

How to compress every file in a directory into its own compressed file (files not in current directory)

If the location DATA/AAA/INPUT contains n files (the file names are random job names), I need to create tar files for all the n files in the DATA/AAA/OUTPUT location with a common name format. So, if ...
0 votes
1 answer
124 views

What is the fastest / best compression for large dar archives

I'm using dar (like tar, but optimized for hard disks) for backing up RAID volumes. They're modest sized for RAIDs, at perhaps 3 - 10 TB. I'm aiming to put the results on 8 TB external drives, but ...
  • 115
2 votes
1 answer
597 views

How can you compress images in a PDF?

How can you increase the JPEG compression level on a PDF using batch tools under Linux? Obviously you can use gs -dPDFSETTINGS=/screen or /ebook, but that downsamples the PDF - it reduces the DPI. It'...
  • 2,332
0 votes
1 answer
241 views

compress: No compression -- file unchanged

I was trying to compress an image on Linux, specifically using the compress command, and it wasn't working. Can you please advise, based on the output below, what I'm doing wrong and how I could fix ...

1
2 3 4 5
8