linux 命令中的大于号、小于号的作用及代表的意思 | 您所在的位置:网站首页 › linux两个大于号是追加 › linux 命令中的大于号、小于号的作用及代表的意思 |
在linux中,大家也许会经常看到 test.txt aaa ^C [root@oracle1 test]# cat test.txt aaa [root@oracle1 test]# cat < test.txt aaa 那我们换成 > test.txt [root@oracle1 test]# 再换成>> 会出现什么情况,发现元文本追加了一行 . [root@oracle1 test]# cat >> test.txt echo "aaa" ^C [root@oracle1 test]# ^C [root@oracle1 test]# cat test.txt aaa echo "aaa"接下来换个命令来试试下面使用redis,我们往文本中写两行命令 然后将他作为redis 客户端的输入文件,发现命令执行了。 [root@oracle1 src]# cat >/home/test/test.txt auth password get foo ^C [root@oracle1 src]# ./redis-cli -h 127.0.0.1 -p 6379 < /home/test/test.txt OK (nil) [root@oracle1 src]# ^C [root@oracle1 src]#那么追加到文本 3、< 将后面文件作为前面命令的输入 4、 |
CopyRight 2018-2019 实验室设备网 版权所有 |