Linux Server Learning (i)

Source: Internet
Author: User

First, connect the server

Download a Linux-connected SSH tool under Windows, I use the putty here. Once filled in hostname (hostname, can be the server domain name can also be the corresponding IP), port (port number default is 22), ConnectionType (connection mode, here is SSH), and then click Open to connect.

  

  The first connection is to be prompted whether to trust this connection, of course, if not point is directly out of the.

  

  Pop-up black box first to log in to login as, enter the user name and enter the password, enter the code is not visible, after the output and then enter, log in.

  

  Root indicates the current user name, vultr is the computer name, ~ Indicates the current directory, and the root user directory is/root/

  

Second, familiar with the simple common view operation

1,LS view the current directory of files, you will find just a simple list of file names

2,Ls-al when using this command, there has been a lot of things, more than LS detailed, but also a lot of files. Careful observation of the file name is the beginning of a point, these are hidden files.

  

The file name is preceded by a lot of parameters, namely permissions, user, user group, file size, modification time, filename

3,ls directory name so that you can view any directory below the file

  There is a little trick, the first few letters of the input File and tab key can be automatically complete.

4,CD directory name switch operation directory (can be multi-level directory)

5,CD: return to the previous level of the directory, of course, can also be used continuously, such as CD. /.. Return to the next level.

Ii. creation, copying, cutting and deletion of learning documents

Switch directories to the root CD/understand the purpose of common files

0,Touch file name to create a file, in the non-operating directory when created, touch back to add the correct directory address

1,mkdir folder name Create folder, can also be created in the non-current operation directory, as long as the mkdir followed by the correct directory is OK.

2,mkdir-p folder name/file name to create a multi-level directory

3,CP file name 1 file name 2 copy copy file name 1 is the source file, file name 2 is the name after the copy. In the same directory, these two names must be different, copy to another directory, the file name 2 is the detailed directory plus the file name, such as CP 1.txt/home/1.txt (file name arbitrary)

4,MV file name directory move cut, and copy the difference is that the CP after the source file is still in, and the MV after the source file is not (equivalent to a file changed position)

5,RM file name Remove delete file, or RM directory/file name (delete files under non-operation directory)

6,rm-r directory Delete directory, note Do not do rm-r/This will delete all the files in the root directory, and will never find back. Linux does not have a trash box feature.

Third, vim command, edit file

1,vim filename Open file, you can look inside the content.

2, I press on the keyboard I into the editing mode, you can edit in it

3. Press ESC two times ESC to exit edit mode

4. : W Save edit content

5, : Q exit file,: Wq means save modify and exit,: q! Indicates a forced exit without making any modifications.

Four, disconnect

   exit Direct Exit putty

Five, all the commands are practice practice, with more, naturally feel very smooth. Learn to be happy!

  

Linux Server Learning (i)

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.