2023年8月3日发(作者:)

linux压缩命令gzip_Linuxgzip命令⽰例linux压缩命令gzipLinux offers an array of tools for compressing and decompressing files. In this tutorial, we take a look at the Linux gzipcommand 提供了⼀系列⽤于压缩和解压缩⽂件的⼯具。 在本教程中,我们将研究Linux gzip命令⼯具。Gzip is a file format as well as a software application which was created by Mark Adler and Jean-Loup Gailly and has been inuse since the early Unix 是Mark Adler和Jean-Loup Gailly创建的⼀种⽂件格式以及⼀种软件应⽤程序,⾃早期Unix Systems以来就⼀直在使⽤。Linux gzip command uses the (LZ77) Lempel-Ziv coding during its operations. Let’s dive in and see the various examplesof how Gzip can be gzip命令在操作期间使⽤(LZ77)Lempel-Ziv编码。 让我们深⼊了解如何使⽤Gzip的各种⽰例。使⽤Linux gzip命令压缩⽂件 (Compress a File using Linux gzip Command)Compressing a file with gzip command is a walk in the park. Simply pass the file name as the argument as shown.⽤gzip命令压缩⽂件是在公园散步。 只需将⽂件名作为参数传递即可,如图所⽰。$ gzip [filename]The final compressed file acquires a suffix .gz.最终的压缩⽂件将获得后缀.gz 。For example, I have 4 text files in my current working directory as shown below.例如,我当前的⼯作⽬录中有4个⽂本⽂件,如下所⽰。To compress using gzip, the syntax will be.要使⽤gzip压缩 ,语法将是。$ gzip view the compressed file, use the ls command.要查看压缩⽂件,请使⽤ls命令。Output输出量It’s worth noting that the original text file has now been compressed and bears the .gz compression suffix.值得注意的是,原始⽂本⽂件现已压缩,并带有.gz压缩后缀。强制gzip不替换/删除原始⽂件 (Force gzip not to replace/delete the original file)As we have seen in the previous example, gzip replaces the original file and turns it into a compressed r, you can opt to retain the original file using the -k option as shown.正如我们在前⾯的⽰例中看到的那样,gzip替换了原始⽂件并将其转换为压缩⽂件。

但是,您可以选择使⽤-k选项保留原始⽂件,如图所⽰。gzip -k [file-name]For example, to compress to a .gz file whie retaining the same file execute the command.例如,要将压缩为保留相同⽂件的.gz⽂件,请执⾏以下命令。$ gzip -k sure to verify using the ls command and note that the original file is still present.确保使⽤ls命令进⾏验证,并注意原始的⽂件仍然存在。使⽤gzip递归压缩⽂件 (Recursively compress files using gzip)To compress all files recursively inside a directory, use the -r option as shown.要递归压缩⽬录中的所有⽂件,请使⽤-r选项,如图所⽰。$ gzip -r *For example, there are 4 text file inside the test folder as shown.例如,如图所⽰, 测试⽂件夹中有4个⽂本⽂件。To compress all the files at a go run:要⼀次性压缩所有⽂件:$ gzip -r *Output输出量使⽤gzip解压缩⽂件 (Uncompress a file using gzip)If you want to uncompress a file, use the -d option a shown in the syntax below.如果要解压缩⽂件,请使⽤-d选项,语法如下所⽰。$ gzip -d [compressed file-name]For instance, to uncompress run:例如,要解压缩,请运⾏:$ gzip -d ut输出量As you can see, the original compressed file disappears.如您所见,原始压缩⽂件消失了。列出使⽤gzip压缩⽂件的详细信息 (List details of a compressed file using gzip)To list details of a compressed file make use of the -l option as shown.要列出压缩⽂件的详细信息,请使⽤-l选项,如图所⽰。$ gzip -l [compressed-file-name]For example,例如,$ gzip -l ut输出量如何调节gzip压缩的速度 (How to Regulate Speed of gzip Compression)Gzip command also allows you to regulate the speed of compression. You can achieve this by specifying a hyphen (-)followed by a digit or number between 1 (Fastest) to 9 (Best). The default compression speed is 命令还允许您调节压缩速度。 您可以通过指定连字符(-)后接1(最快)到9(最佳)之间的数字或数字来实现此⽬的。 默认压缩速度为6。gzip -5 [file-name]For instance:例如:gzip -5 can use any digit/number between 1 and 9, where 1 denotes the fastest compression rate and 9 denotes the slowestcompression rate but the most preferred.您可以使⽤1到9之间的任何数字/数字,其中1表⽰最快的压缩率,⽽9表⽰最慢的压缩率,但最优选。And that wraps up the gzip command usage. Feel free to share your thoughts on this. Your feedback is most welcome.这样就结束了gzip命令的⽤法。 随时分享您的想法。 ⾮常欢迎您提供反馈。linux压缩命令gzip

2023年8月3日发(作者:)

linux压缩命令gzip_Linuxgzip命令⽰例linux压缩命令gzipLinux offers an array of tools for compressing and decompressing files. In this tutorial, we take a look at the Linux gzipcommand 提供了⼀系列⽤于压缩和解压缩⽂件的⼯具。 在本教程中,我们将研究Linux gzip命令⼯具。Gzip is a file format as well as a software application which was created by Mark Adler and Jean-Loup Gailly and has been inuse since the early Unix 是Mark Adler和Jean-Loup Gailly创建的⼀种⽂件格式以及⼀种软件应⽤程序,⾃早期Unix Systems以来就⼀直在使⽤。Linux gzip command uses the (LZ77) Lempel-Ziv coding during its operations. Let’s dive in and see the various examplesof how Gzip can be gzip命令在操作期间使⽤(LZ77)Lempel-Ziv编码。 让我们深⼊了解如何使⽤Gzip的各种⽰例。使⽤Linux gzip命令压缩⽂件 (Compress a File using Linux gzip Command)Compressing a file with gzip command is a walk in the park. Simply pass the file name as the argument as shown.⽤gzip命令压缩⽂件是在公园散步。 只需将⽂件名作为参数传递即可,如图所⽰。$ gzip [filename]The final compressed file acquires a suffix .gz.最终的压缩⽂件将获得后缀.gz 。For example, I have 4 text files in my current working directory as shown below.例如,我当前的⼯作⽬录中有4个⽂本⽂件,如下所⽰。To compress using gzip, the syntax will be.要使⽤gzip压缩 ,语法将是。$ gzip view the compressed file, use the ls command.要查看压缩⽂件,请使⽤ls命令。Output输出量It’s worth noting that the original text file has now been compressed and bears the .gz compression suffix.值得注意的是,原始⽂本⽂件现已压缩,并带有.gz压缩后缀。强制gzip不替换/删除原始⽂件 (Force gzip not to replace/delete the original file)As we have seen in the previous example, gzip replaces the original file and turns it into a compressed r, you can opt to retain the original file using the -k option as shown.正如我们在前⾯的⽰例中看到的那样,gzip替换了原始⽂件并将其转换为压缩⽂件。

但是,您可以选择使⽤-k选项保留原始⽂件,如图所⽰。gzip -k [file-name]For example, to compress to a .gz file whie retaining the same file execute the command.例如,要将压缩为保留相同⽂件的.gz⽂件,请执⾏以下命令。$ gzip -k sure to verify using the ls command and note that the original file is still present.确保使⽤ls命令进⾏验证,并注意原始的⽂件仍然存在。使⽤gzip递归压缩⽂件 (Recursively compress files using gzip)To compress all files recursively inside a directory, use the -r option as shown.要递归压缩⽬录中的所有⽂件,请使⽤-r选项,如图所⽰。$ gzip -r *For example, there are 4 text file inside the test folder as shown.例如,如图所⽰, 测试⽂件夹中有4个⽂本⽂件。To compress all the files at a go run:要⼀次性压缩所有⽂件:$ gzip -r *Output输出量使⽤gzip解压缩⽂件 (Uncompress a file using gzip)If you want to uncompress a file, use the -d option a shown in the syntax below.如果要解压缩⽂件,请使⽤-d选项,语法如下所⽰。$ gzip -d [compressed file-name]For instance, to uncompress run:例如,要解压缩,请运⾏:$ gzip -d ut输出量As you can see, the original compressed file disappears.如您所见,原始压缩⽂件消失了。列出使⽤gzip压缩⽂件的详细信息 (List details of a compressed file using gzip)To list details of a compressed file make use of the -l option as shown.要列出压缩⽂件的详细信息,请使⽤-l选项,如图所⽰。$ gzip -l [compressed-file-name]For example,例如,$ gzip -l ut输出量如何调节gzip压缩的速度 (How to Regulate Speed of gzip Compression)Gzip command also allows you to regulate the speed of compression. You can achieve this by specifying a hyphen (-)followed by a digit or number between 1 (Fastest) to 9 (Best). The default compression speed is 命令还允许您调节压缩速度。 您可以通过指定连字符(-)后接1(最快)到9(最佳)之间的数字或数字来实现此⽬的。 默认压缩速度为6。gzip -5 [file-name]For instance:例如:gzip -5 can use any digit/number between 1 and 9, where 1 denotes the fastest compression rate and 9 denotes the slowestcompression rate but the most preferred.您可以使⽤1到9之间的任何数字/数字,其中1表⽰最快的压缩率,⽽9表⽰最慢的压缩率,但最优选。And that wraps up the gzip command usage. Feel free to share your thoughts on this. Your feedback is most welcome.这样就结束了gzip命令的⽤法。 随时分享您的想法。 ⾮常欢迎您提供反馈。linux压缩命令gzip