Upload, download, package, and decompress Linux Files

Source: Internet
Author: User
Tags scp command

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.