Linux VPS Use command to learn notes

Source: Internet
Author: User
Tags mkdir rar rar extension zip vps


I use the putty, follow the operating procedures of this VPS, record these common commands

passwd: Modify Password

Cd:current Directory: access to catalogue;

Eg:cd/home into the home directory; CD/to root directory

Ls:list: Lists the current directory;

Mkdir:make directory: New Catalog;

Eg:mkdir AA

Mv:move: Moving files;

Usage: MV FileName file directory

Rm:remove: removal of files;

wget: Download; Usage: wget download address

Zip:zip compression;

How to use: Zip-r filename.zip filesdir (in this case, Filename.zip represents the file you created, and Filesdir represents the directory where you want to place the new zip file.) The-r option specifies that you want to include all files included in the Filesdir directory recursively (recursively). )

Eg:zip-r aa.zip AA

Eg:zip-r filename.zip file1 file2 file3/usr/work/file4 (to compress the contents of File1, File2, File3, and/usr/work/flie4 directories (assuming this directory exists) And then put it in the Filename.zip file)

Unzip:zip decompression;

How to use: Unzip Filename.zip

Tar:tar packaging; (large file tar is better than zip, and the TAR Compression Pack command is useful for VPS file backups.) And decompression can use unzip command. The use of tar is consistent with the Zip method)

Here is a simpler example of how to package all the files in the/etc directory into/tmp/etc.tar:
[Root@linux ~]# tar-cvf/tmp/etc.tar/etc <== packaged only, not compressed
[Root@linux ~]# tar-zcvf/tmp/etc.tar.gz/etc <== packaged, gzip compressed
[Root@linux ~]# tar-jcvf/tmp/etc.tar.bz2/etc <== after packaging to bzip2 compression

Note that there is a space between the directory that generated the package and the directory being packaged.

Attachment: Complete parameters of tar
[Root@linux ~]# Tar–cxtzjvfppn

-C: Create a compressed file parameter instruction (create meaning);
-x: Unlock a parameter command for a compressed file!
-T: View the files inside the Tarfile!
"Special note that in the release of the parameters, c/x/t can only exist one!" Not exist at the same time! Because it is not possible to compress and decompress at the same time. 】
-Z: Do you have gzip properties at the same time? Is that the need to use gzip compression?
-j: Do you have bzip2 properties at the same time? That is to use bzip2 compression?
-V: Display files during compression! This is commonly used, but is not recommended for use in the background execution process!
-F: Use file name, please note that after F to immediately receive file name Oh! Don't add any more parameters!
"For example, using TAR-ZCVFP tfile sfile is the wrong way to write a TAR-ZCVPF tfile sfile." 】
-P: Use the original properties of the original file (properties will not be changed according to the user)
-P: You can use absolute paths to compress!
-N: Newer than the following date (YYYY/MM/DD) will be packaged into the newly created file!

Untar:tar solution package;

===========================================================================

Under Linux decompression rar

To process A. rar file under Linux, you need to install RAR for Linux

Then install its installation actions as follows:
# TAR-XZPVF Rarlinux-5.0.b8.tar.gz
# CD RAR
# make
This is installed, installed after the RAR and unrar these two programs, RAR is a compression program, Unrar is the decompression program. They have a lot of parameter options to illustrate their usage
# rar a All *.jpg
This command compresses all. jpg files into a RAR package named All.rar, which automatically attaches the. rar extension to the package name.
# Unrar E All.rar
This command extracts all the files in the All.rar.

My main use is this decompression, before Windows backup down all the data is RAR

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.