Linux Bash re-picked 2016-8-16

Source: Internet
Author: User

Quotes supported by bash:

"" Double quotation mark: Weak reference, you can implement variable substitution (the variable will be replaced with a value)

SSH Echo " Directory is $ ((pwd)) "  0

' Single quote: Strong reference, do not complete variable substitution (what you input will output)

SSH Echo ' Directory is $ ((pwd)) ' Directory is $ ((pwd))

File name wildcard:

* Any length matching

? Match only one character

[] matches any single character within the specified range

[^] Take the inverse match ls [^0-9]

i/p Redirect:

> Overwrite Output

ls /tmp/>/tmp/cat /tmp/ssh-6xolw4llamwesystemd-private- 30HjJisystemd-private-ch9s6xsystemd-private-mnh52bvarrryum_save_tx. -16.09-Geneva. K8wko4.yumtx

>> Append Output

[Email protected] ~]# ll/tmp/>>/tmp/Chen[[email protected]~]#Cat/tmp/Chen Total dosage --rw-r--r--.1Root root0August -  -: Onechendrwx------.2Chen Chen atAugust -  the:xx SSH-6xolw4llamwedrwx------.3Root root -August -  the:xxsystemd-private-30HjJidrwx------.3Root root -August -  the:xxsystemd-private-ch9s6xdrwx------.3Root root -August -  the:xxsystemd-private-mnh52b-rw-r--r--.1Root root139August -  -:TenVara-rw-r--r--.1Root root134August -  -: thevarrr-RW-------.1Root root602344August -  the: GenevaYum_save_tx. .- ,-16.09- Geneva. K8wko4.yumtx

(2> overwrite error output 2>> append error Output)

&> redirect standard output or error output to the same file, whether executed correctly or not

[Email protected] tmp]#ls/tmp/&>/tmp/Ccc1[[email protected] tmp]#Cat/tmp/ccc1 ccc1SSH-6xolw4llamwesystemd-private-30HjJisystemd-private-ch9s6xsystemd-private-Mnh52byum_save_tx. .- ,-16.09- Geneva. K8wko4.yumtx[[email protected] tmp]#ls/TMPPPP &>/tmp/Ccc2[[email protected] tmp]#Cat/tmp/CCC2ls: Unable to access/TMPPPP: No file or directory

< input redirection

<< Create a document here

Cat << END

Cat << EOF

Pipeline: |

Linux Bash re-picked 2016-8-16

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.