What are the commands that are frequently used in Redhat Linux?

Source: Internet
Author: User
Keywords Linux redhat
Tags copy directory displays exit file files find http

What are the commands that are frequently used in Redhat Linux?

<1>ls: Column directory.

Usage: ls or ls dirname, parameter:-a displays all files,-----

<2>mkdir: Build a directory.

Usage: mkdir dirname, Parameters:-P build Multilevel directory, such as:

mkdir a/b/c/d/e/f-P

<3>find: Find files.

Usage: Find indir-http://www.aliyun.com/zixun/aggregation/11696.html ">name Filename,indir is the directory you want to look for, filename is the file name you are looking for ( You can use wildcard characters, when you use wildcard characters, it is best to enclose them in single quotes, otherwise there will be errors sometimes, use cases:

Find-name test*

Example:

[Root@localhost usr]# Find-name nginx*
./local/webserver/nginx
./local/webserver/nginx/conf/nginx.conf
./local/webserver/nginx/conf/nginx.conf.default
./local/webserver/nginx/sbin/nginx
./local/webserver/nginx/nginx.pid

Finds a file in the current directory that begins with test.

<4>grep: Finds the specified string in the file.

Usage: grep string filename, find string (preferably in double quotes) in filename (available wildcard characters). Parameter:-R is found in the filename in all subdirectories. Case:

grep Hello *.c-r

Look for hello in all. c files in the current directory, including subdirectories.

<5>vi: Editor.

Usage: VI filename. FileName is the text file you want to edit. With the implementation of VI filename, you may find that you can not edit the text content, do not worry, this is because VI has not entered the editing state, press A or I can enter the editing state, after entering the editing state you can edit the text. To exit the edit state, press the ESC key. The following actions are to be in a non editable state. Find text: Enter/and the text you want to find and enter. Exit: Input: And Q and enter, if you modify the text, then you want to use: q! Enter to exit. Save: Enter: W return, if read-only file: w!. Save exit: Input: Wq carriage return, if read-only: wq! carriage return. Cancel: Press U on it, press once to cancel one step, you can cancel multiple steps. Copy and paste one line of text: Move the cursor anywhere on the line you want to copy, press YY (even press two times y), move the cursor to the previous line where you want to paste the place, press p, the text will be inserted to the next line on the line where the cursor is located, and all rows following the cursor's line automatically move down one line. Copy and paste multiple lines of text: the same as copying a row, but YY changed to first enter the number of rows to be copied followed by YY, followed by the same action. Move the cursor to the specified line, enter: and line number and enter, such as move to 123 lines: 123 Back to the car, move to the end: $ return

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.