answersLogoWhite

0


Best Answer

The 'compress' command is normally supplied in all Unix and Linux distributions. The Gzip protocol is also very common, as is the original pkzip format.

7z is also used along with others, but those are the most popular.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

Linux support various compression formats the popular ones are

1. gz (gzip)

2. bz (bZip)

3. rar

4. zip

The most popular are bzip and gzip all s/w distributions come in form of tarball are either gz or bz.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

There are many file compressors to choose from. 7zip, zip, gzip, bzip2, lzma, and ect. Probably the 2 most common are gzip and bzip2.

Run 'man <program name>' to read the manual for the one you want to use.

Below are some examples compressing the file test.txt .

$ 7z a test.7z test.txt

$ zip test.zip test.txt

$ gzip test.txt

$ bzip2 test.txt

$ lzma test.txt

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the command used to compress a file in Linux?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What Linux command sets a files permission?

In Linux the chmod command is used to set file permissions.


Which Linux command is used to copy a file?

in terminal it is : #cp file_a file_b


What command is used to assign executable permission to all for the filetxt in Linux?

the command to make anything executable is chmod +x &lt;file&gt;


Which command is used to create an empty file with file size zero bytes so that you can write in these files later in unix and Linux?

touch newfile will make a new empty file in linux os !


Which command is used to move a file?

The command MV is used to move a file in simple Linux Code. This command will move files and directories from one spot to another spot. To move a file, one would simply type in the letters MV before its name.


What Linux command is used to compare the difference between two file display the difference?

The command is: diff file1.txt file2.txt


Which command can be used to execute a series of Linux commands at a specified time?

You can schedule jobs using cron and the /etc/crontab file, or you can use the "at" command


What Linux command is used for displaying all the records with space or special characters between fields in the file?

cat


What utility on Linux can be used to copy a file including text and executable program binary files?

The cp command does that.


What Linux command displays the last part of a file without editing it?

The tail command can be used to output the last part of a text file. The default is to show the last 10 lines of a file and options are available to override this.


When pack command is used the original file size is reduced by?

There is no "pack" command in Linux. However, there are numerous compression and archival programs available for use."tar" is an archival program. It does no compression, but allows you to put multiple files into one."gzip" is a compression program. However, it can only compress one file. Used in conjunction with tar, it is just slightly better than the ".zip" format."bzip2" is another compression program with better compression ratios. Like "gzip," it is for compressing single files only. It is usually used in conjunction with "tar.""zip" and "unzip" are programs for the "ZIP" archive format. It performs both compression and archival.Answer:I'm not sure if this is an improvement to the above answer or not. As mentioned above, there is no "pack" command in Linux but, in addition to the excellent answer above, a compiled program may be 'stripped' in Linux with the 'strip' command and this will usually serve to reduce the binary file size. The Linux 'strip' command modifies the binary program's symbol tables.


What Linux command is used to zip only a subdirectory?

In order to zip a subdirectory in Linux you would use the zip command with the recursive flag to specify that it should add all files under that directory into the zip file. The command would then be zip -r .zip .