Introduction to Linux
Contents
Basic commands for your research
Useful Linux commands
Some of the general tips for Linux commands
How to use grep, find , wc, and diff commands
How to extract and archive files
How to use other's Linux...when you do not have your own Linux system.
Troubleshootings
How to extract and archive files
The tar, which stands for "tape archiver", in general archives files and extracts files from an archived file.
The specified commands follow "tar" and the qualifiers modify what the commands do. Thus, the style is a little different
from the above commands. The followings are the basic commands:
Abbreviation | Description(s) |
c | Creates an archive. |
A | Appends tar files to an archive. |
d | Compares an archive to files on disk. |
t | Lists the contents. |
x | Extracts files from a tar archive. |
The qualifiers are:
Abbreviation | Description(s) |
f | Uses the file called "file" on the computer called host as the archive file. |
j | Processes through bz2 compression. |
M | Creates (extracts from) multiple archives. |
v | Shows all of the lists archived or extracted. |
z | Processes through gunzip. |
This archives the all files in directory, "mydirect", as mine.tar.
$ tar cvf mine.tar mydirct/
|
This extracts files from mine.tar.
You can also choose files you want to archive.
$ tar cvf research.tar data1.txt data2.txt data3.txt
|
The tar just archives the files and it does not compress the series of files. If you want to compress the files with gzip, type as folloes:
$ tar zcvf mine.tar.gz file1.txt file2.txt file3.txt
|
To extract files from the archive,
If you want to add the file(s) in a tar archive, you type:
$ tar rf mine.tar file1.txt
|
To look at the files inside the archive without extracting, you will trype:
Back to Electronics Page
Back to Hiro's Physics Main