tar command help
I had a question about using the tar command. Ive been working on trying to compress some files.
So lets say I have 4 files backup1.txt backup2.txt backup3.txt backup4.txt And these are the only files in the directory I can run tar cvf * to combine the files and create a single compressed file However since im not specifying a file name how would the tar command name the compressed file. Would it just be backup.txt.tar or just backup.tar? Im just not sure how the naming would work. |
it would create an archive called backup1.txt which would contain 3 files (backup2.txt, backup3.txt and backup4.txt)
|
Quote:
Also, use the standard syntax -- prefix a "-" to the option list: Code:
$ tar -cvf archive_name.tar * Quote:
You must give TAR either a filename or "-" as a signal to dump the archive onto the output stream: Code:
$ tar -cvf - * # to output stream Code:
$ tar -cvf archive.tar * # to a file named "archive.tar" Code:
$ man tar |
Quote:
tar -cvf backup * Here backup will become the compressed file Also I recommend using cpio rather than tar you can also use find . | cpio -ocv > backup you can extract backup using cpio -i < backup Hope this will be helpfull |
Quote:
Code:
$ tar -czvf backup.tar.gz * # gzip compression Code:
$ tar -cjvf backup.tar.bz2 * # BZ2 compression |
Thanks everyone for your help hopefully once I have a few months getting used to this system Ill be able to help other people out as well.
|
All times are GMT -5. The time now is 10:16 AM. |