Instructions for using zforce command on Linux
The gzip command is a popular tool used to compress / decompress files in Linux.TipsMake.com presents the basics of this tool in the article: Some basic Terminal commands in Linux Mint 11. This utility creates .gz files. But sometimes (such as during file transfers) this .gz file extension may be removed. But not too worried! There is a tool that forces the .gz extension back to these compressed files.
The tool mentioned is zforce and in this tutorial, we will discuss how to use this command line utility. But before starting, please note that all the examples here are tested on Ubuntu 18.04 LTS.
Linux zforce command
As mentioned at the beginning, the zforce command allows the user to force the extension '.gz' back on all gzip files. The following is its syntax:
zforce [ name . ]
And here's how this tool's homepage explains it: "Zforce forces the .gz extension back on all gzip files so that gzip doesn't compress them twice."
This can be useful for files whose names are truncated when transferring files. On systems, the file name is limited to 14 characters, so the original name is truncated to make room for the .gz suffix .
For example, 12345678901234 was renamed 12345678901.gz. But a short file name, such as foo.tgz will be preserved.
For example, we have a .gz file named 'files'. As can be seen, the .gz extension is missing in the file name. So what to do is simply use the following command:
zforce files
And this is the ouput that this command creates:
files -- replaced with files.gz
As you can see, the command indicates that 'files' have been replaced with 'files.gz'. And when you check the .gz file in the current directory, you will see a file named files.gz.
Now, if there is a folder filled with .gz files whose names have been truncated, there is no need to enter each file name. Do the same as the example below:
You can see that all 3 files in the example have the .gz extension. Rest assured that if any file already contains the .gz extension in the name, then this operation will remain the same.
If you use a lot of gzip and encounter the .gz extension being truncated from the file name, you now know how to handle it.
Good luck!
See more:
- 14 interesting Linux commands in Terminal
- Basic Linux commands everyone needs to know
- 7 commands to manipulate the most basic files and folders everyone must know
You should read it
May be interested
- How to use ss command on Linuxthe ss command is a new alternative to the classic netstat. you can use it on linux to get data about network connections. here's how to work with this helpful tool.
- 11 uses of ps command in Linuxfor system administrators, ps is a frequently used tool. the ps command is used to list the processes currently running on the system, with many available filtering and display modes via flags and arguments.
- How to limit access to su command in Linuxif you have added linux to your data center or are just using a single linux machine for your business, you need to make sure it is as secure as possible.
- 12 things Linux is easier to do in the command line than graphical softwaregraphical user interfaces (guis) were invented to make life easier for computer users, so it's very common to use them to perform most everyday tasks.
- 11 df commands in Linux (with example)with the df command in linux, you can easily check your system for details about disk space and file size. these 12 examples of df commands will show you how to do them in detail.
- How to use the Linux command line on Android with Termuxandroid is a very operating system 'capacity with more and more desktop accessibility applications. however, sometimes you want to make some things on android that can be as easy as desktop. fortunately, you can use the termux tool, which builds on the existing infrastructure and provides a command line environment that allows you to install real linux applications on your android device.
- How to use the history command in Linuxas you spend more and more time in terminal sessions, you will constantly find new commands that make everyday tasks more efficient. the gnu history command is one of them.
- The dd command in Linux, How to use the dd commanddd is a command line utility for unix-like and unix operating systems, with the main purpose of converting and copying files.
- Instructions for using dpkg command on Linux Debianthis article will talk about the basics of package management in debian and how to manage software packages using the dpkg command.
- Use the Top command to see the processes running in Linuxthe top command in linux is used to display all processes running in the linux environment. this tutorial shows you how to use the top command through explaining the various parameters available and the content they display.