当前位置:网站首页>5. This simple "echo" usage, can the child next door!
5. This simple "echo" usage, can the child next door!
2022-07-25 10:29:00 【Is a stupid child】
List of articles
One , Common options
- echo -n Indicates no line feed output
- echo -e Output escape character , Output the escaped content to the screen
Two , Commonly used escape characters
\b After escape, it is equivalent to pressing backspace key (backspace) , But the premise is "\b" There is a character after ; “\b" It means to delete the first one characters ,”\b\b" Indicates deletion of the first two characters

\c Don't wrap output , stay "\c" If there are no characters after , The effect is equivalent to echo -n; But when "\c" When characters still exist after ,"\c" The following characters will not be output
\n Line break , The character to be output is from "\n" Start a new line
\f Line break , But the beginning of the new line after the newline is connected to the end of the previous line
\v And \f identical
\t Insert after turn tab, That is, the horizontal tab
\r Move the cursor to the beginning of the line , But don't wrap , It is equivalent to using "\r" Later characters overwrite "\r" Characters of the same length before : But when "\r" When there are no characters after ,"\r" The preceding characters will not be overwritten
\ Indicates insertion "" In itself
i=`echo "11,22,33,44"`
echo ${i%,*}
11,22,33
// From the last countdown to the shortest matching part ( use %) The following comma is deleted
echo ${i%%,*}
11
// From the last countdown to the longest matching part ( use %%) The following commas are deleted
echo ${i#*,}
22,33,44
// From the beginning to the shortest matching part ( use #) The following comma is deleted
echo ${i##*, }
44
// From the beginning to the longest matching part ( use ##) The following comma is deleted
3、 ... and 、 Use echo Command print special effect text
- echo Output the content of the specified color
- usage : Need to combine -e Options and “\033” Use it together
- Format :
echo –e “\033[ Foreground color ; The background color m character string \033[0m”
notes : The position of foreground color and background color can be interchanged
Insert the code slice foreground color here :30m-37m
black :echo -e “\033[30m Black lettering \033[0m”
Red :echo -e “\033[31m Red character \033[0m”
green :echo -e “\033[32m The green word \033[0m”
×××:echo -e “\033[33m ××× word \033[0m”
Blue :echo -e “\033[34m Blue words \033[0m”
violet :echo -e “\033[35m Purple words \033[0m”
Sky blue :echo -e “\033[36m Sky blue \033[0m”
white :echo -e “\033[37m White words \033[0m”
The background color :40m-47m
black :echo -e “\033[40m Black base \033[0m”
Red :echo -e “\033[41m Red background \033[0m”
green :echo -e “\033[42m Green bottom \033[0m”
×××:echo -e “\033[43m ××× At the end of \033[0m”
Blue :echo -e “\033[44m blue ground \033[0m”
violet :echo -e “\033[45m Purple background \033[0m”
Sky blue :echo -e “\033[46m The sky is blue \033[0m”
white :echo -e “\033[47m White background \033[0m”
- Description of control options
\033[0m Turn off all properties
\033[1m Set high brightness
\033[4m Underline
\033[5m flashing
\033[7m Reflexion
\033[8m Blanking
\033[30m — \33[37m The foreground
\033[40m — \33[47m Background color
\033[nA The cursor moves up n That's ok
\033[nB The cursor moves down n That's ok
\033[nC The cursor moves right n That's ok
\033[nD The cursor moves left n That's ok
\033[y;xH Set cursor position
\033[2J Clear the screen
\033[K Clear the contents from the cursor to the end of the line
\033[s Save cursor position
\033[u Restore cursor position
\033[?25l hide cursor
\033[?25h Show cursor
n That's ok
\033[y;xH Set cursor position
\033[2J Clear the screen
\033[K Clear the contents from the cursor to the end of the line
\033[s Save cursor position
\033[u Restore cursor position
\033[?25l hide cursor
\033[?25h Show cursor
边栏推荐
猜你喜欢

Angr (II) -- angr_ ctf

Virtual private line network deployment

Duplicate SSL_ Anti spoofing, spoofing attacks and deep forgery detection using wav2vec 2.0 and data enhanced automatic speaker authentication

PyTorch 对 Batch 中每个样本计算损失 Loss for each sample

Vscode latex workshop set xelatex compilation

Angr(六)——angr_ctf

Open虚拟专线网络负载均衡

Mysql离线部署

4.FTP服务配置与原理

VoxCeleb1 数据集下载
随机推荐
Array static initialization, traversal, maximum value
Angr (VI) -- angr_ ctf
5.NFS共享服务和ssh远程控制服务
Bug elements
Small knowledge of common classes
TCP transmission
Swing的组件图标
Output stream in io stream
Swing组件之单选与多选按钮
测试计划、测试方案
复现 ASVspoof 2021 baseline RawNet2
Angr(八)——angr_ctf
多线程——五大状态
Mysql离线部署
9.shell文本处理三剑客之awk
Trojang attack on neural networks paper reading notes
Swing component Icon
升级 GLIBC 2.29 checking LD_LIBRARY_PATH variable... contains current directory error 解决方案
一、unittest框架和pytest框架的区别
切换 shell 命令行终端(bash/zsh)后,conda 无法使用: command not found