Follow the old boy student movement-Basics-commands

Source: Internet
Author: User

This series is only for personal finishing notes and learning, such as want to learn the old Boys course, please contact the old boy education, thank you!


Follow the old boy student movement-Basics-commands


One, the order

1. mkdir (Make directory)

Description: Create a directory

Example: Mkdir/data

Parameter:-P

For example: Mkdir-p/data/a/* Create parent directory data and subdirectories a

2. CD (change directory)

Description: Change Directory

Example: cd/data/* Switch to/data directory


3. pwd

Description: View the current path


4. Touch

Description: Create a file

Example: Touch aaa.txt

Touch 123{a.  Z}/* Create file 123a, 123b 、...... 123z and 26 files

5, Vi

Description: Editor

I/* Enter edit mode

Press shift+: Enter command mode

w/* Write Save

Q/* exit

! /* Mandatory

6:vim

Description: Advanced Editor


7:cat

Description: view edit, append

Example: Cat aaa.txt \* View Aaa.txt

Cat >a.txt \* Edit A.txt

Cat >>/data/oldboy.txt <<eof I am as studying Linux EOF \*: Build oldboy.txt and append content from EOF to Oldboy.txt

8:echo

Description: Print

Example: Echo "I am studying Linux"


9:CP (copy)

Description: Copy

Parameters: R/* Copy directory, recursive

F/* Mandatory

d/* If the source file is a link file, copy the linked file zodiac rather than the file itself

I/* If the target file already exists, ask when overwriting

P/* Copy the past along with the properties of the document

A/* equivalent to PDR

U/* If the destination file exists, the destination file is copied older than the source file

10:mv

Description: Move

Example: mv/data/1.txt/data/abc/

11:ls (list)

Description: View List

Parameter:-L (Long) long format displays directory or file attributes

Parameter:-D display Directory

Parameters:-a show hidden files

Example: LS/ETC/* View directories and files under/etc

12:man

Description: Command Help

Example: Man command


Second, special symbols


1:> or 1>

Description: Redirect

Example: Echo "I am studying Linux" > Aa.txt


2: >> or 1>>

Description: Redirect and append content to the trailer


3:< or <0

Description: Redirect

4:<< or <<0

Description: Redirect and append content to the trailer

5:

Standard input (stdin) code: 0 Use < or << data flow from right to left

Normal output (STDOUT) code: 1 Use > or >> Data flow from left to right

Error output (stderr) code: 2 Use 2> or 2>>

Example: Ech 111 > Correct.txt 2> error.txt/* Outputs the correct output to the Correct.txt and outputs the error to Error.txt

For example: Echo oldboy >a.txt 2>&1/* Outputs both the correct output and the wrong output to the A.txt



Iii. Combination of commands


Four, shortcut keys

1. Tab

Description: Command Completion



This article from "Tericut" blog, declined reprint!

Follow the old boy student movement-Basics-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.