Upload, download, package, and decompress Linux Files
Upload, download, package, and decompress Linux Files
A Linux file refers to the transfer of files from other machines (such as Windows) to a Linux machine.
The following code uses the scp command to perform this operation:
Scp local directory user @ ip: Linux File storage directory
Open the git Console
Because Windows does not support scp commands, additional software implementation is required. git supports Linux commands. Git is usually used for software development.
Enter the scp command, for example:
scp d:/1.txt zhang@192.168.199.198:/home/zhang/test
Result
Linux File Download
Download is simple. On the git console, enter the following command:
# Copy 1.txt to d disk scp zhang@192.168.199.198:/home/zhang/test/1.txt d :/
Linux File packaging and Compression
In Linux, the tar command is often used, and the tar command is used below to package.
Tar-cvf log.tar 1.log is only packaged and not compressed! # If the z-compressed tar package tar-zcvf log.tar.gz 2.log is packaged with .tar.gz or tgz, use gzip to compress. # If j logs are added, use .tar.bz2 to represent the tar package tar-jcvf log.tar.bz2 3.log compressed by bzip2.
Linux File Extraction
Tar Decompression
tar -xvf log.tar
Tar.gz Decompression
tar -zxvf log.tar.gz
Tar.bz2 Decompression
tar -jxvf log.tar.bz2
Query files in the tar package
tar -jtv -f filename.tar.bz2tar -jtv -f filename.tar.gz