Linux Learning-Basic commands

Source: Internet
Author: User
Tags clear screen create directory parent directory

$ represents a normal user under Linux, #为root用户, you can switch to the root user after using the Su-root command and entering the root user's password correctly.

RM Delete, create directory mkdir directory name, mkdir-p directory name/directory name,-p parent directory does not exist when creating parent directory

PWD Displays the current directory absolute path

Clear Clear Screen

Copy: CP filename directory name, normal copy file, CP filename Directory name/file name, move file and rename; cp-r directory name, copy directory

View: ll directory name, view its next file, Ll-a directory name, you can view the hidden file, ll-h directory name, friendly display content, you can show the file size of how many kb,ll show the file size of bytes

View small files available cat file name, more file name load partial file, enter load next line, SPACEBAR to load next page, B to return to previous page, q exit, less-mn file name with more use, tail-digital file name, view the last few lines of the file

Find command: Find directory name-name ' string to be found '

Delete the RM-CF directory name, c for the iteration, F for Force, no longer ask whether to delete and delete directly, prohibit the use of rm-cf/* Delete all files under the root directory

Notepad features vim name, vim file name, can be simple single-row, multi-line copy Delete (general mode), press I key into the insert mode, you can edit the operation; Press ESC to return to normal mode, press: Key to enter the bottom row mode, you can force exit not save (q! ) and the Save after exit operation (Wq), you can modify the project's configuration file.

Pipeline | , which is used to connect the command, grep needs to search for a string to search for the file, can return the search content in the file, and ll |grep the test command, search the current directory, the file name containing the test tag and the directory name.

The Grep-i command, the-I parameter, represents ignoring case.

*.tar, packaged but not compressed, *.tar.gz packaged and compressed, TAR-ZCVF compressed package name. tar.gz, compression parameter-ZCVF in turn need to use GIZP compression, set up a compressed file parameter command Create, compression process display file, Create a compressed file name. TAR-ZXVF Compressed Package name-c Specifies the path, extracted to the specified path directory.

View System process commands: Ps-ef;ps-ef | The Gerp-i test represents a process that queries all system processes with the test identity.

Force kill process Command: Kill-9 pid,pid is the process number.

Ifconfig equivalent to Windows ipconfig command, query IP information, ping IP address, test and destination address connectivity, CTRL + C exit connectivity test.

CentOS restart command: reboot; Shutdown command: Halt

Network Setup Setup command.

Permission-Related: W Write permission, r Read permission, x run permission,-no permissions, chmod permission settings need to change the file name, chmod u=rwx Test.java Indicates that the Test.java file has full permissions for the owning user, that u represents the owning user right, that G represents the group permissions, that O represents the other user rights, that a represents all user rights, and that Chmod-r modifies the permissions of the folder.

Linux Learning-Basic commands

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.