在Linux命令行模式下,当遇到一对上分隔符时(就是和~在一个键子上的符号,长的和单引号很像的)时,
线执行上分隔符内的命令,然后将结果作为参数带入命令行中,这就是命令替换。
touch 功能1
date +%Y%m%d%k%M%S 命令先执行输出指定格式的时间
然后这个时间作为touch命令的参数,生成文件20120617201931.txt
[jl@localhost 文档]$ touch `date +%Y%m%d%k%M%S`.txt
[jl@localhost 文档]$ ls
20120617201931.txt f3.c~ hh store.c~ test.sh
cop.c~ fi.c~ hh~ test test.sh~
f1.c~ file1.c~ main.c~ testif.sh test.txt
f2.c~ hello.c~ makefile~ testif.sh~ vi_test.c~
[jl@localhost 文档]$ cat 20120617201931.txt
[jl@localhost 文档]$
功能2
[jl@localhost 文档]$ touch test.txt // test.txt 文件本来就存在 它的修改时间和访问时间是
执行完
[jl@localhost 文档]$ touch test.txt
[jl@localhost 文档]$
test.txt的修改时间和访问时间变为