mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-02-17 19:49:39 +00:00
Update cheatsheets
This commit is contained in:
33
echo
Normal file
33
echo
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# echo
|
||||
|
||||
> Print given arguments.
|
||||
> More information: <https://www.gnu.org/software/coreutils/echo>.
|
||||
|
||||
- Print a text message. Note: quotes are optional:
|
||||
|
||||
`echo "{{Hello World}}"`
|
||||
|
||||
- Print a message with environment variables:
|
||||
|
||||
`echo "{{My path is $PATH}}"`
|
||||
|
||||
- Print a message without the trailing newline:
|
||||
|
||||
`echo -n "{{Hello World}}"`
|
||||
|
||||
- Append a message to the file:
|
||||
|
||||
`echo "{{Hello World}}" >> {{file.txt}}`
|
||||
|
||||
- Enable interpretation of backslash escapes (special characters):
|
||||
|
||||
`echo -e "{{Column 1 Column 2}}"`
|
||||
|
||||
- Print the exit status of the last executed command (Note: In Windows Command Prompt and PowerShell the equivalent commands are `echo %errorlevel%` and `$lastexitcode` respectively):
|
||||
|
||||
`echo $?`
|
||||
Reference in New Issue
Block a user