polewopolis.blogg.se

Find files by date linux compress old
Find files by date linux compress old












rw-rw-r- 1 shs shs 18115234 Apr 15 17:57 bigfile.bz2Ī relative newcomer to the compression command team, xz is a front runner in terms of how well it compresses files. rw-rw-r- 1 shs shs 21606751 Apr 15 17:57 bigfile.gzĪs with the gzip command, bzip2 will compress the file that you select "in place", leaving only the original file. In other words, the original file will be replaced by the encrypted file. Unlike the commands described above, gzip will encrypt the files "in place". You just type "gzip" followed by the name of the file you want to compress. The syntax is straightforward except that, as with tar, you have to remember that your original file should be the last argument on the command line. The zip command creates a compressed file while leaving the original file intact. Here’s an example: $ tar cfz bin.tgz bin/* ^ ^ | +- files to include + new file zip To collect a number of files together and compress the resultant “tar ball” in one command, use the same basic syntax, but specify the files to be included as a group in place of the single file. You will be left with both the original file and the compressed file once the compression is complete.

find files by date linux compress old find files by date linux compress old find files by date linux compress old

If you prefer, you can use the tar.gz extension which might make the character of the file a bit more obvious, but most Linux users will probably recognize tgz as meaning the same thing – the combination of tar and gz to indicate that the file is a compressed tar file. Note the significant reduction in the file size. To use tar for this, just identify the file as you would a group of files with a “tar cfz newtarfile filename” command like this: $ tar cfz bigfile.tgz bigfile You can use tar to compress a single file as easily as a group though this offers no particular advantage over using gzip directly.














Find files by date linux compress old