Creation
To create a tar containing "files":
Code:
tar cf file.tar files
To create a tar with Gzip compression:
Code:
tar czf file.tar.gz files
To create a tar with Bzip2 compression:
Code:
tar cjf file.tar.bz2 files
Extraction
To extract files from tar:
To extract files from tar using Gzip:
Code:
tar xzf file.tar.gz
To extract files from tar using Bzip2:
My terminal just went crazy adding in laptop twice command line which i didn't type in in the first place where did the tar xflattop come from i have not entered that at all ??????
The only entry i made was the tar xvjf ...bz2 i feel i have no control over my terminal at the moment got any idea ????
thanks
laptop:~$ tar xflaptop:~$ tar xvjf naev-0.4.2.tar.bz2
tar: You may not specify more than one `-Acdtrux' option
Try `tar --help' or `tar --usage' for more information.
matt@matt-laptop:~$ tar: naev-0.4.2.tar.bz2: Cannot open: No such file or directory
No command 'tar:' found, did you mean:
Command 'tar' from package 'tar' (main)
Command 'tart' from package 'tart' (universe)
tar:: command not found
matt@matt-laptop:~$ tar: Error is not recoverable: exiting now
No command 'tar:' found, did you mean:
Command 'tar' from package 'tar' (main)
Command 'tart' from package 'tart' (universe)
tar:: command not found
matt@matt-laptop:~$ tar: Child returned status 2
No command 'tar:' found, did you mean:
Command 'tar' from package 'tar' (main)
Command 'tart' from package 'tart' (universe)
tar:: command not found
Code:
tar xjf file.tar.bz2
For a tar, "f" is used, for Gzip "zf" is used, and for Bzip2 "jf" is used. Place a "c" before each of those to use the compression, and an "x" to extract from the compressed file(s).
Bookmarks