Common special symbols in Ubuntu

Source: Internet
Author: User
(& Gt;) redirection output symbol usage: Command & gt; file name feature: overwrite (when the input and output files are the same file, the file content is cleared; not suitable for continuous redirection) typical applications :~ $ Catab & gt; c (merge files )~ Descriecho"helloworld">hello.txt...

 

(>) Redirection output symbol

Usage: Command> file name

Feature: overwrite (when the input and output files are the same file, the file content is cleared; not suitable for continuous redirection)

Typical applications:

~ $ Cat a B> c (merge files)

~ $ Echo "hello world"> hello.txt (input content to the specified file)

~ $./Test. sh>/dev/null (delete program input)

(>>) Output redirection

Usage: Command> file name

Feature: append

Typical applications:

~ $ Cat hello.txt> hello2.txt

~ $./Test. sh> test. echo

(2>) error redirection

Usage: Command 2> file name

Feature: OVERWRITE

Typical applications:

~ $./Test. sh> test. error

(2>) error redirection output symbol

Usage: Command 2> file name

Feature: append error messages

Typical applications:

~ $./Test. sh 2> test. error

(|) MPs queue symbol

Usage: Command 1 | Command 2

Feature: The previous command output serves as the input of the next command.

Typical applications:

~ $ Ps-ef | grep root

(*) Match any character

(? ) Match any character

(&) Run commands in the background (daemon)

Usage: Command 1 &

Feature: close the current terminal window and the program is still running

Typical applications:

~ $./Test. sh &

(&) Connect multiple commands

Usage: Command 1 & Command 2

Feature: If Command 1 is successfully executed, continue to execute command 2; otherwise, do not execute command 2.

Typical applications:

~ $ Apt-get update & apt-get dist-upgrade

(|) Logical or

Usage: Command 1 | Command 2

Feature: If Command 1 is successfully executed, Command 2 is not executed; otherwise, Command 2 is executed.

(!) Non-logical

Feature: exclude a specified range.

([X-y]) specified range

(#) Comment

("") Double quotation marks

Feature: the content contained in it is a common character, except ''\ $.

('') Single quotes

Feature: use the content contained in it as a common character without exception.

('') Inverted quotation marks

Feature: execute the content it contains

(\) Escape characters

Usage; \ symbol

Feature: remove the specific meaning of a symbol to make it a common punctuation.

($) Variable call symbol

Usage: $ variable

Feature: call a variable to obtain the value of the variable

(;) Command separator

Usage: Command 1; Command 2

Feature: execute commands sequentially in one line of statements.

() Overall execution

({}) Variable separation

 

From mr_yqs

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.