![]() ![]() All the example, are displays for the default tar archive files. Here is some more useful tar command examples for handling the archive files. Similarly, you can update content of other tar formats archives, like: tar -uzf /var//var//var/www Other Useful tar command examples ![]() For example, to update an archive called “archive.tar” with a new file called “new_file.txt”, you can use the following command: tar -uvf archive.tar new_file.txt To update an existing tar archive, you can use the -u (or -update) option in the tar command. ![]() Similarly, you can list content of other tar formats like: tar ztvf tar jtvf 2 tar Jtvf How to Update a tar archive For example, to list the files in an archive called “archive.tar”, you can use the following command: tar -tvf archive.tar To list the files in a tar archive, you can use the -t (or -list) option in the tar command. Similarly, you can extract content from the other tar formats like: tar -xzf tar -xjf 2 tar -xJf How to List content of a tar archive For example, to extract the contents of “archive.tar”, use the following command: tar -xvf archive.tar To extract files from a tar archive, use the “ -x” option followed by the “ -f” option to specify the name of the archive file. This takes more time to compress than others and provides the highest compressed file that above. tar -cjf /var/wwwĬompress all content of /var/file including all subdirectories. For example, to create a gzip compressed archive file named “” from the current directory and its contents, use the following command: tar -czf /var/wwwĬompress all content of /var/file including all subdirectories. To compress a tar archive, you can use the “z” option to compress the archive using gzip or the “j” option to compress the archive using bzip2. For example, to create an archive file named “example.tar” from the current directory and its contents, use the following command: tar -cvf archive.tar /var/www To create a tar archive, use the “c” option followed by the “f” option to specify the name of the archive file. Use the following examples to create new archive file in different formats like. -j: compress the archive file using bzip2.-z: compress the archive file using gzip.-f: specify the name of the archive file.Some of the most commonly used options are: The options used with the tar command are used to specify the behavior of the command. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |