当前位置:网站首页>Echo command – output a string or extract the value of a shell variable
Echo command – output a string or extract the value of a shell variable
2022-06-25 05:59:00 【ProYuan28】
echo The command is used to output the extracted value of string or variable on the terminal device , This is Linux One of the most common commands in the system , But the operation is very simple .
People usually add... Before variables $ Extracting the value of a variable by means of symbols , for example :$PATH, And then use echo Command to output . Or use it directly echo Command outputs a string to the screen , Play the role of prompting users .
Grammar format :echo [ Parameters ] [ character string ]
Common parameters :
| -n | Don't output the ending newline |
| -e “\a” | Sound a warning tone |
| -e “\b” | Delete the preceding character |
| -e “\c” | No newline at the end |
| -e “\f” | Line break , The cursor stays in the original coordinate position |
| -e “\n” | Line break , Move the cursor to the beginning of the line |
| -e “\r” | Move the cursor to the beginning of the line , But don't wrap |
| -E | No backslash transfer , And -e Parameter function is the opposite |
| —version | View version information |
| --help | View help information |
Reference examples
Output a string :
[[email protected] ~]# echo "LinuxCool.com" LinuxCool.com
The extracted value of the output variable :
[[email protected] ~]# echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
Escape the content , Not allow $ The function of extracting variable value of symbol takes effect :
[[email protected] ~]# echo \$PATH $PATH
Combined with the output redirection character , Import string information into a file :
[[email protected] ~]# echo "It is a test" > linuxcool
Use backquotes to execute commands , And output the result to the terminal :
[[email protected] ~]# echo `date`
Output content with line breaks :
[[email protected] ~]# echo -e "a\nb\nc" a b c
Delete a character from the output message , Look at the numbers 3 Vanished :
[[email protected] ~]# echo -e "123\b456" 12456
边栏推荐
- How do product managers get started? How do they learn when no one takes them?
- Go implements LRU cache
- Create a complete binary tree in array order
- Feignclient reported an error npe:null
- By inserting a section break, the word header, footer, and page number can start from any page
- Websocket in the promotion of vegetable farmers
- Day18 (set, generic, hash table, tree, stack and queue, graph, array and linked list)
- Common cluster deployment schemes in redis
- Do you know what a three-tier architecture is?
- CVPR2021-Semi-supervised Domain Adaptation based on Dual-level Domain Mixing for Semantic Segmentati
猜你喜欢
SAP ui5 tutorial for beginners part XXVI - detailed steps for using OData service with mock server trial version
Some common errors and solutions of using SAP ui5 to consume OData services

Mongodb delete data

Unsupervised domain adaptation in semantic segmentation:a review unsupervised domain adaptation in semantic segmentation: a review

JMeter stress testing and agent recording
SAP ui5 application development tutorial 32 - how to create a custom SAP ui5 control
Technology inventory: Technology Evolution and Future Trend Outlook of cloud native Middleware
How the sap ui5 framework performs single step debugging of batch requests
Part 33 of SAP ui5 application development tutorial - trial version of responsiveness of SAP ui5 applications
Technology inventory: past, present and future of Message Oriented Middleware
随机推荐
[OSPF routing calculation (class I LSA router, class II LSA network, and class III LSA sum net)] -20211228-30
Soft exam information system project manager_ Management Science (Operations Research) -- senior information system project manager of soft test 033
MySQL -- optimize query statements and use not in with cases
The locally developed SAP ui5 application is deployed to the ABAP server to perform error analysis
Folding mobile phones are expected to explode, or help Samsung compete with apple and Chinese mobile phones
Kyma application connectivity feature introduction
Unsupervised domain adaptation in semantic segmentation:a review unsupervised domain adaptation in semantic segmentation: a review
Cnpm installation
HashSet implementation class
Go language map sorting (key/value sorting)
Day21 performance test process
How SAP ui5 device type detection device API works
How do product managers get started? How do they learn when no one takes them?
Guava common collection tool classes
Instant messaging project (I)
What are the reasons why most webmasters choose Hong Kong site group servers?
Transformations of pytorch torch torch vision
What happens when you use "-fno exceptions", "new T"- With “-fno-exceptions”, what happens with “new T”?
SAP ui5 beginner tutorial 25 - using proxy server to solve the cross domain problem of SAP ui5 application accessing remote OData service trial version
Word quickly makes multiple single-sided table labels, number plates, etc