当前位置:网站首页>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
边栏推荐
- Design of IM login server and message server
- 50 days countdown! Are you ready for the Landbridge cup provincial tournament?
- Is the securities account of Qiantang education safe? Is it reliable?
- Oracle SQL statement operand: rounding, rounding, differentiation and formatting
- Technology inventory: Technology Evolution and Future Trend Outlook of cloud native Middleware
- The simplest way to tell you is to hash and not hash
- [QT] for multithreaded programs, do not use the printf() function to print out
- Guava immutable set
- Word quickly makes multiple single-sided table labels, number plates, etc
- Mirror image of binary tree
猜你喜欢
Soft exam information system project manager_ Information system security management - Senior Information System Project Manager of soft test 026
Timed thread pool
Click to send text messages without response is a common problem for many users in building the elegant grass Dragonfly Q system - solve the problem of clicking to send text messages without response
SAP ui5 beginner tutorial No. 27 - unit test tool quNit introduction trial version for SAP ui5 application
Use generator-easy-ui5 to quickly create the engineering structure of SAP ui5 applications
Do you know what a three-tier architecture is?
How SAP ui5 device type detection device API works
SAP ui5 application development tutorial XXIX - Introduction to routing and navigation functions of SAP ui5 trial version
Day21 performance test process
Instant messaging project (I)
随机推荐
[interview with a large factory] meituan had two meetings. Was there a surprise in the end?
Leetcode topic [array] -36- effective Sudoku
Day13 (inner class, anonymous inner class, API common class)
Kyma application connectivity feature introduction
ArcGIS Engine + Visual Studio installation tutorial
Soft exam information system project manager_ Management Science (Operations Research) -- senior information system project manager of soft test 033
[OSPF routing calculation (class I LSA router, class II LSA network, and class III LSA sum net)] -20211228-30
Day21 performance test process
Soft exam information system project manager_ Management Science (Operations Research) 2--- senior information system project manager of soft test 034
Yunda's cloud based business in Taiwan construction 𞓜 practical school
Semantic segmentation fcns in the wild: pixel level adaptive and constraint based adaptation
Invalid bound statement (not found)
An example of recursion, the full permutation problem of 1~n
C simple operation mongodb
Getting started with mongodb
Aiot project that is an introduction to the basics of the Internet of things and can be implemented in practice
Mirror image of binary tree
Deep learning non local neural networks
Technology Review: Interpretation of cloud native architecture trend in 2022
Solve some prompt codes that pychar cannot recognize selenium