The below commands work great to achieve our goal:
Archive creation and extraction:
Using the tar command:
- tar -cvf TEST.tar ./* - Running this command compresses all the files located in current directory into TEST.tar file
- tar -xvf TEST.tar - This command will extract all the files from the archive TEST.tar
- tar -tf TEST.tar - This command will list all the files in the archive TEST.tar
Using the gzip command:
- gzip Test.txt - This command will create a gzip file Test.txt.gz
- To unzip the file - gunzip Test.txt.gz
Using the zip comand:
1. zip Test1 Test.txt - This will create a file Test1.zip
2. unzip Test1.zip -d /tmp/Test - This command will unzip the files in Test1.zip to the /tmp/Test path
Let us know if this was helpful !!
No comments:
Post a Comment
Please share your thoughts and let us know the topics you want covered