Linux basic commands

Source: Internet
Author: User

Tree: View directory Permissions

mkdir: Creating a Directory

-P = parent Directory

-v = verbose detailed procedure

MKDIR-PV/MNT/TEST/{X/M,Y}MKDIR-PV/MNT/TEST/{A,D}_{B,C}

Command line expansion:

The first will create a directory:/mnt/test/x/m and/mnt/test/y

The second will create a directory:/mnt/test/a_b,/mnt/test/a_c,/mnt/test/d_b,/mnt/test/d_c

Touch

The main purpose is to change the timestamp of the file

-m:modify modification Time

-a:access Access Time

-T: Set time

You can create a file: Touch a creates a file


To view files:

Cat

-N: Show line numbers

-E: Displays the end of line character

MORE: Split screen display

Less: Split screen display

Head: Show the first few lines

Tail: Show the following lines

-F: Debugging time will be used, just write the contents of the file immediately display

Cut

-D: Delimiter

-F: The first few fields

Cut-d "-F 3-4/opt/logs/log-2017-05-04.php2017-05-04 17:17:392017-05-04 17:17:392017-05-04 17:18:092017-05-04 17:18:09

Sort

-F: Ignore case

-U: Repeat not displayed

-N: Sort in numeric form

-R: Reverse

-T: Field delimiter

-K: Number of fields

sort -r -t  '   '  -k 4 /opt/logs/log-2017-05-04.phpERROR -  2017-05-04 17:18:09 --> severity: warning  --> stream_select ():  unable to select [4]: interrupted system call  (max_fd=5)  ERROR -  2017-05-04 17:18:09 --> severity: warning  --> stream_select ():  unable to select [4]: Interrupted system call  (max_fd=5)  error  - 2017-05-04 17:17:39 --> severity: 8192  --> mysql_ Pconnect ():  the mysql extension is deprecated and will be removed  in the future: use mysqli or PDO instead ERROR -  2017-05-04 17:17:39 --> severity: 8192  --> mysql_pconnect ():  the mysql extension Is deprecated and will be removed in the future: use mysqli  or pdo instead

Uniq

-D: Show only duplicate rows

-D: Show duplicate rows (multiple lines)

-C: Number of repetitions


\RM: Restore RM command The most primitive effect

Linux 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.