Tar Command

1 min


The tar command in Linux is used to create, extract, and manipulate files in the .tar (tape archive) format.

Here are a few examples of how to use tar:

  1. Create a new .tar archive:
tar -cvf archive.tar /path/to/folder
  1. Extract the contents of an existing .tar archive:
tar -xvf archive.tar -C /path/to/extract/to
  1. Extract the contents of a .tar.gz archive:
tar -xzvf archive.tar.gz -C /path/to/extract/to
  1. Extract the contents of a .tar.bz2 archive:
tar -xjvf archive.tar.bz2 -C /path/to/extract/to
  1. View the contents of a .tar archive without extracting it:
tar -tvf archive.tar
  1. Add new files to an existing .tar archive:
tar -rvf archive.tar /path/to/new/file

These are just a few examples of how to use the tar command. There are many more options and variations that can be used to perform various tasks.


0 Comments

 

7 BUSINESS SECRETS

GET STARTED

This will close in 0 seconds