![]() The “-t” option can be used to list the contents of an archive file without extracting it. For example, the following command creates a simple home directory tarball. $ tar -cjvf 2 sales1.pdf sales2.pdf sales3.pdfīesides archiving files, you can also compress directories. Similarly, when using bzip2 compression (using the “-j” option), the archive file must have the extension “.tar.bz2” as a suffix. In this example, the command creates a file named “” from the three PDF files. $ tar -czvf sales1.pdf sales2.pdf sales3.pdf The accepted convention is to add the compression suffix to the compressed file.įor example, when using gzip compression (using the “-z” option), the file must have the suffix “.tar.gz”. The tar utility allows you to create archive files using various compression algorithms such as xz, gzip and bzip2. W − The -w option verifies an archive file. j − Create an archive file using the bzip2 compression z − Creates a tar file using gzip compression r − This updates a file or directory located inside a. u − This archives a file and then adds it to an existing archive file. t − This lists all the files inside an archive file. v − This prints verbose information for any tar operation on the terminal. f − Specifies the filename of the archive file. x − The option extracts the archive file. ![]() The tar command provides the following options − Let's look at some of the options provided with the tar command. The tar command accepts the following syntax − $ $ tar In this guide, we'll demonstrate, through examples, how to create, list, edit, and extract tar archive files, and cover some of the more commonly used tar command options. ![]() An archive file is a compressed file that contains one or more files bundled together for more accessible storage and portability. It is short for Tape Archive and is used to create and extract archive files. The tar command in Linux is one of the most essential commands when it comes to file management.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |