Shell Application Tips

Source: Internet
Author: User
Tags clear screen

1. Press the TAB key for the command to be padded

2, clear or ctrl+l clear screen

3, ctrl+u Delete the command before the cursor

4. History view executed commands

5, the key of the arrow keys can see the executed command

1. Command aliases

Example: Alias COPY=CP//The CP command can be implemented with copy at this time, if the command has parameters, you need to enclose the command in quotation marks

Remove Alias: Unalias alias

2. Input \ Output redirect

(1) Output redirection

Example: Ls-l/tmp >/TMP.MSG//Save the results of the previous command in a later file

LS-L/tmp >>/TMP.MSG//Append the results of the previous command to the following file

(2) Input redirection

Example: Wall </etc/filename to broadcast the information in filename '

(3) Error redirection

Syntax:2> error output redirect, 2 is the file identifier of the standard error output

Example: Cp-r/usr/backup/usr.bak 2>/bak.error command execution error message saved to Bak.error file

3. Pipeline

Sends the output of one command to another command as input to another command

Grammar:

Command 1| command 2....| Command n

Instance:

Ls-l | More

Ls-l/etc | grep Init

4. Command connector

(1):

Each command executes sequentially in sequence.

(2) &&

There is a logic and relationship between the execution of the preceding command, and the subsequent command executes when the previous command executes successfully.

(3) | |

The execution of the previous command has a logical or relationship, and when the first command executes successfully, the second command is not executed; the second command executes when the first command fails

5. Command substitution

To use the output of one command as a parameter to another command

Syntax: Command 1 ' command 2 '//is not a single quotation mark, is the left side of the keyboard 1 small apostrophe; At this point, the output of command 2 as a parameter of command 1

Shell Application Tips

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.