Shell Simple to use

Source: Internet
Author: User

First, the history of the command line

Press up and down to traverse the most recently entered command

<CTRL+r> after entering incremental mode

This can be viewed in the previous 2000 history

$ vim ~/.bash_history

Second, edit the command line

  • <ctrl k>: Delete the part from the cursor to the end of the line
  • <ctrl u>: Delete the part from the cursor to the beginning of the line
  • <alt D>: Delete the part from the cursor to the end of the current word
  • <ctrl W>: Remove the part from the cursor to the beginning of the current word
  • <ctrl A>: Moves the cursor to the beginning of the line
  • <ctrl E>: Moves the cursor to the end of the line
  • <alt A>: Moves the cursor to the current Word header
  • <alt E>: Moves the cursor to the end of the current word
  • <ctrl y>: Inserting recently deleted words

Iii. Ordering of commands

Execute the Command1 first, regardless of whether Command1 is wrong, then execute Command2

Command1;command2

Execute Command2 only if Command1 is properly run

Command1 & Command2

Iv. output Redirection

">" is the output redirect , you can save the command output to a file, ">>" and ">" function similarly,

The difference is that ">" is a new or rewritten file, and ">>" appends the content to the end of the file.

Shell Simple to use

Related Article

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.