This article summarizes how to compress files under Linux and the decompression method of common compressed file formats. Some decompression software can support multiple compression package formats at the same time, so the decompression method below may not be unique. For detailed usage, you need to be able to view it by parameters such as -h. At present, Ubuntu and other system platforms are becoming more and more perfect, and the compression and decompression functions are also evolving to intelligence and interface. It is believed that in the near future, like WINDOWS, there is no need to memorize any compression and decompression commands.
First, compressed files
This is only compressed into tar and tar.gz format, example:
1, compress the current directory filename file into filename.tar
tar -cvf filename.tar filename
2, again compress filename.tar into gz format, get filename.tar.gz
gzip filename.tar
Using reminder symbolic link questions:
Second, decompress the file
Unzip the operation as follows, the decompression target is the current folder.
1, unzip.tar.gz2
bzip2 -d filename.tar.bz2
tar -xhvf filename.tar
If a symbolic link is used , be sure to use the -h parameter.
2, decompress .gz,.tgz
gunzip filename.gz
gunzip filename.tgz
3, decompress .tar.Z
tar -xvZf filename.tar.Z
4, extract .tar.gz,.tgz
tar -xvf filename.tar
tar -zxvf filename.tar.gz
tar -zxvf filename.tgz
Unzip Note:
If the original compressed file has a symbolic link (link file), currently It seems that only the command can be decompressed (-h parameter). If you use the compressed file manager to extract it, you will lose the symbolic link (not studied in depth), but extracting the .tar file does not seem to lose the symbolic link, so if you encounter a missing symbolic link Or you can try the command line mode, other formats are similar.
5. Unzip.rpm
rpm2cpio filename.rpm |
Cpio -div
6, unzip.zip
unzip filename.zip
Record your favorite Linux system commands for easy reference later, and find that memory is getting
Why should there be process priority? This does not seem to require too much explanation. After all,
The use of X capacitors and Y capacitors, and their differences: 1. DC blocking 2. Bypass 3. Coupl
In order to ensure the normal operation of the Linux system and accurately solve various system prob
Linux shell logical operators, logical expressions detailed
How to make Squid display local time
Convert DOS batch files to shell scripts
CentOS PPTP VPN Server (32-bit) installation basic tutorial
Linux server attack and defense technology detailed
Linux restart command reboot using tutorial
Solve ssh automatic disconnection failure
Interprocess communication learning summary
Win 2003 Terminal Server in LAN
Win8 system IE prompts "has stopped working" What should I do?
How to get Win8.1 into the desktop 2 kinds of Win8.1 boot directly into the desktop method
How to prohibit others from accessing the computer C drive?
Win7 shows hidden folder method
Windows Server 2008 Security Performance Analysis
Win7 system game can not be full screen
Acceleration of the Windows XP operating system
Win7 system boot pop-up "Windwos drive is not ready" How to solve