How To Use Tar Command In Linux?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
1. To create an archive:
tar -cvf archive_name.tar /path/to/directory-or-file
2. To extract an archive:
tar -xvf archive_name.tar
3. To view the contents of an archive:
tar -tvf archive_name.tar
4. To add a new file to an existing archive:
tar -rvf archive_name.tar /path/to/new/file
5. To update an existing file in an archive:
tar -uvf archive_name.tar /path/to/existing/file
6. To extract a specific file from an archive:
tar -xvf archive_name.tar /path/to/file
7. To delete a file from an archive:
tar –delete -f archive_name.tar /path/to/file