datamatrix 2d barcode for C# $ ls -l -rw-r--r-1 sam sam 33287 Mar 1 22:40 zach.jpg in .NET Receive barcode code 128 in .NET $ ls -l -rw-r--r-1 sam sam 33287 Mar 1 22:40 zach.jpg

$ ls -l -rw-r--r-1 sam sam 33287 Mar 1 22:40 zach.jpg using none todeploy none in web,windows applicationprinting data matrix c# The bzip2 utility can reduc none for none e the size of the file by only 28 percent because the image is already in a compressed format:. QR Code Features $ bzip2 -v zach.jpg g: 1.

391:1, 5.749 bits/byte, 28.13% saved, 33287 in, 23922 out.

$ ls -l -rw-r--r--. 1 sam sam 23922 Mar 1 22:40 zach.jpg.bz2 Refer to the bzip2 man page none for none ,, and the Bzip2 mini-HOWTO (see page 130) for more information.

. bunzip2 and bzcat: Decompress a File You can use the bunzip2 uti none for none lity to restore a file that has been compressed with bzip2:. Compressing and Archiving Files 163 $ bunzip2 letter_e.bz2 $ ls none none -l -rw-rw-r-- 1 sam sam 584000 Mar $ bunzip2 zach.jpg.

bz2 $ ls -l -rw-r--r-- 1 sam sam 33287 Mar. 1 22:31 letter_e 1 22:40 zach.jpg The bzcat utility displays a file that has been compressed with bzip2. The equivalent of cat for .bz2 files, bzcat decompresses the compressed data and displays the contents of the decompressed file.

Like cat, bzcat does not change the source file. The pipe in the following example redirects the output of bzcat so that instead of being displayed on the screen it becomes the input to head, which displays the first two lines of the file:. $ bzcat letter_e.bz2 head -2 eeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee. After bzcat is run, the con none for none tents of is unchanged; the file is still stored on the disk in compressed form..

bzip2recover The bzip2recover utility su none for none pports limited data recovery from media errors. Give the command bzip2recover followed by the name of the compressed, corrupted file from which you want to try to recover data..

gzip: Compresses a File gunzip and zcat The gzip (GNU zip) utility is older and less efficient than bzip2. Its flags and operation are very similar to those of bzip2. A file compressed by gzip is marked by a .

gz filename extension. Linux stores manual pages in gzip format to save disk space; likewise, files you download from the Internet are frequently in gzip format. Use gzip, gunzip, and zcat just as you would use bzip2, bunzip2, and bzcat, respectively.

Refer to the gzip info page for more information. The compress utility can also compress files, albeit not as well as gzip. This utility marks a file it has compressed by adding .

Z to its name.. compress gzip versus zip tip Do not confuse gzip and none for none gunzip with the zip and unzip utilities. These last two are used to pack . and unpack zip archives con taining several files compressed into a single file that has been imported from or is being exported to a system running Windows. The zip utility constructs a zip archive, whereas unzip unpacks zip archives. The zip and unzip utilities are compatible with PKZIP, a Windows program that compresses and archives files.

. tar: Packs and Unpacks Archives The tar utility performs ma ny functions. Its name is short for tape archive, as its original function was to create and read archive and backup tapes. Today it is used to create a single file (called a tar file, archive, or tarball) from multiple files or directory hierarchies and to extract files from a tar file.

The cpio utility performs a similar function.. 164 5 The Linux Utilities In the following example, t he first ls shows the existence and sizes of the files g, b, and d. Next tar uses the c (create), v (verbose), and f (write to or read from a file) options2 to create an archive named all.tar from these files.

Each line output displays the name of the file tar is appending to the archive it is creating. The tar utility adds overhead when it creates an archive. The next command shows that the archive file all.

tar occupies about 9,700 bytes, whereas the sum of the sizes of the three files is about 6,000 bytes. This overhead is more appreciable on smaller files, such as the ones in this example:. $ ls -l g b d -rw-r--r-1 je none for none nny jenny 1302 Aug 20 14:16 g -rw-r--r-1 jenny other 1178 Aug 20 14:16 b -rw-r--r-1 jenny jenny 3783 Aug 20 14:17 d $ tar -cvf all.tar g b d g b d $ ls -l all.tar -rw-r--r-1 jenny jenny 9728 Aug 20 14:17 all.

tar $ tar -tvf all.tar -rw-r--r-- jenny/jenny 1302 2008-08-20 14:16 g -rw-r--r-- jenny/other 1178 2008-08-20 14:16 b -rw-r--r-- jenny/jenny 3783 2008-08-20 14:17 d. The final command in the pr eceding example uses the t option to display a table of contents for the archive. Use x instead of t to extract files from a tar archive. Omit the v option if you want tar to do its work silently.

You can use bzip2, compress, or gzip to compress tar files, making them easier to store and handle. Many files you download from the Internet will already be in one of these formats. Files that have been processed by tar and compressed by bzip2 frequently have a filename extension of .

tar.bz2 or .tbz.

Those processed by tar and gzip have an extension of .tar.gz or .

tz, whereas files processed by tar and compress use .tar.Z as the extension.

You can unpack a tarred and gzipped file in two steps. (Follow the same procedure if the file was compressed by bzip2, but use bunzip2 instead of gunzip.) The next example shows how to unpack the GNU make utility after it has been downloaded (ftp.

tar.gz):. $ ls -l mak* -rw-rw-r-- 1 s none none am sam 1211924 Jan 20 11:49 make-3.80.tar.

gz $ gunzip mak* $ ls -l mak* -rw-rw-r-- 1 sam sam 4823040 Jan 20 11:49 make-3.80.tar.

2. Although the original UN IX tar did not use a leading hyphen to indicate an option on the command line, it now accepts hyphens. The GNU tar described here will accept tar commands with or without a leading hyphen.

This book uses the hyphen for consistency with most other utilities..
Copyright © . All rights reserved.