linux特殊引导符号
2022/8/22 5:53:19
本文主要是介绍linux特殊引导符号,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
linux特殊引导符号
名称 | 解释 |
---|---|
单引号' ' | 所见即所得,强引用,单引号中内容会原样输出 |
双引号" " | 弱引用,能够识别各种特殊符号、变量、转义符等、解析后输出结果 |
没有引号 | 一般连续字符串、数字、路径可以省略双引号、遇见特殊字符、空格、变量等,必须加上双引号 |
反引号`` | 常用于引用命令结果,同$(命令) |
反引号案例
[[email protected] test_time]# touch date +%F.txt [[email protected] test_time]# ll total 0 -rw-r--r--. 1 root root 0 Aug 21 17:01 date -rw-r--r--. 1 root root 0 Aug 21 17:01 +%F.txt [[email protected] test_time]# touch date "date +%T > ^C [[email protected] test_time]# touch date "date +%T" [[email protected] test_time]# ll total 0 -rw-r--r--. 1 root root 0 Aug 21 17:02 date -rw-r--r--. 1 root root 0 Aug 21 17:02 date +%T -rw-r--r--. 1 root root 0 Aug 21 17:01 +%F.txt [[email protected] test_time]# touch "`date +%T`".txt [[email protected] test_time]# ll total 0 -rw-r--r--. 1 root root 0 Aug 21 17:05 17:05:03.txt -rw-r--r--. 1 root root 0 Aug 21 17:02 date -rw-r--r--. 1 root root 0 Aug 21 17:02 date +%T -rw-r--r--. 1 root root 0 Aug 21 17:01 +%F.txt [[email protected] test_time]# touch "`date +%T`".txt [[email protected] test_time]# touch "`date +%T`".txt##正确 [[email protected] test_time]# ll total 0 -rw-r--r--. 1 root root 0 Aug 21 17:05 17:05:03.txt -rw-r--r--. 1 root root 0 Aug 21 17:06 17:06:09.txt -rw-r--r--. 1 root root 0 Aug 21 17:06 17:06:11.txt -rw-r--r--. 1 root root 0 Aug 21 17:02 date -rw-r--r--. 1 root root 0 Aug 21 17:02 date +%T -rw-r--r--. 1 root root 0 Aug 21 17:01 +%F.txt [[email protected] test_time]# touch "此时时间`date +%T`".txt [[email protected] test_time]# ll total 0 -rw-r--r--. 1 root root 0 Aug 21 17:05 17:05:03.txt -rw-r--r--. 1 root root 0 Aug 21 17:06 17:06:09.txt -rw-r--r--. 1 root root 0 Aug 21 17:06 17:06:11.txt -rw-r--r--. 1 root root 0 Aug 21 17:02 date -rw-r--r--. 1 root root 0 Aug 21 17:02 date +%T -rw-r--r--. 1 root root 0 Aug 21 17:01 +%F.txt -rw-r--r--. 1 root root 0 Aug 21 17:06 此时时间17:06:40.txt [[email protected] test_time]#
输入重定向特殊符号
其他特殊符号
符号 | 解释 |
---|---|
: | 分好,命令分隔符或是结束符 |
# | 1.文件中注释的内容 2.root身份提示符 |
管道符,传递命令结果给下一个命令 | |
$ | 1.$变量,取出变量的值 2.普通用户身份提示符 |
\ | 转义符,将特殊含义的字符还原成普通字符 |
{} | 1生成序列 2.引用变量作为变量与普通字符的分割 |
这篇关于linux特殊引导符号的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-03-30[译]漫画SELinux概念
- 2024-03-29linux 移动文件
- 2024-03-28linux .so file
- 2024-03-28Linux 磁盘管理
- 2024-03-28Linux学习笔记(十三)磁盘管理(一):磁盘分区
- 2024-03-26linux 创建 文件
- 2024-03-25使用SecureCRT对Linux vim进行颜色设置
- 2024-03-202019-2020-12 20199317 《Linux内核原理与分析》 第十二周作业
- 2024-03-20Linux运维的第二周总结
- 2024-03-13how to count number of directories in linux