main logo

How to archive and extract files in CentOS?

How to archive and extract files in CentOS?

In this post we will see how to archive and extract files using terminal commands in CentOS. CentOS is a Community Enterprise operating system which mainly focuses on the server. It is a part of Linux Operating System Distribution and it is free to use. First open the terminal.

Total Time Needed: 30 Minutes

Required tools:

CentOS

Steps to archive and extract files in CentOS

Step 1 : Archieve File
To archive, a file uses the command tar –cvf destination.tar source.tar . For example, to archive Documents to a file named Documents-backup.tar to type the command tar -cvf Documents-backup.tar Documents/ and press enter

Step 2 : Extract the Archieved File
To extract the archived file, use the command tar –xvf filename.tar . For example, to extract Documents-backup file type, the command tar –xvf Documents-backup.tar and press enter.

Step 3 : View Archived File
To view the archived file, use the command tar –tvf filename.tar . For example, to view Documents-backup.tar file type, the command tar –tvf Documents-backup.tar and press enter.

Step 4 : Add New Files
To add new files to the archived file, use the command tar –rvf Destination source. For example, to add passwd.txt to archived file Documents-backup.tar type, the command tar –rvf Documents-backup.tar passwd.txt and press enter

Conclusion:
You ca archive and extract files in CentOS following these steps. If you come across with any doubt please contact Medha Hosting. Our expert Linux administrators will help you 24/7
Read Here: How to Delete Files and Directories in CentOS?

Rakshitha
Rakshitha
Rakshitha is a cloud hosting expert who helps businesses get the most out of their cloud services. She has experience setting up and managing cloud environments to improve performance and scalability. With her cloud certification, Rakshithe provides clear advice on how to use cloud solutions effectively for better business results.
Share
Contents

Related Articles

medhacloud logo
USA:
Medha Cloud Solutions LLC
30 N Gould St Ste R, Sheridan, WY 82801,
Phone: +1 646 775 2855

India:
Medha Cloud Solutions Private Limited
#74, 7th Cross, Krishna Garden InCity Layout. Chikka Kammanahalli, Banneraghatta Road, Bangalore 560083
Phone:+91 93536 44646

E-Mail: support@medhahosting.com
©Medha Cloud 2024. All rights reserved.