linux中grep命令i匹配以制表符开头的行
1、测试数据
[root@rhel7pc1 test]# ls test.txt [root@rhel7pc1 test]# cat test.txt e 5435.1 f d f 1 j k d f e u d j 1 j [root@rhel7pc1 test]# sed -n l test.txt e 5435.1 f d$ \tf 1 j k$ d f\te u$ d j 1 j$
2、
[root@rhel7pc1 test]# ls test.txt [root@rhel7pc1 test]# cat test.txt e 5435.1 f d f 1 j k d f e u d j 1 j [root@rhel7pc1 test]# sed -n l test.txt e 5435.1 f d$ \tf 1 j k$ d f\te u$ d j 1 j$ [root@rhel7pc1 test]# grep "^\t" test.txt ????
[root@rhel7pc1 test]# ls test.txt [root@rhel7pc1 test]# cat test.txt e 5435.1 f d f 1 j k d f e u d j 1 j [root@rhel7pc1 test]# sed -n l test.txt e 5435.1 f d$ \tf 1 j k$ d f\te u$ d j 1 j$ [root@rhel7pc1 test]# grep $'^\t' test.txt f 1 j k
3、匹配包含制表符的行
[root@rhel7pc1 test]# ls test.txt [root@rhel7pc1 test]# cat test.txt e 5435.1 f d f 1 j k d f e u d j 1 j [root@rhel7pc1 test]# sed -n l test.txt e 5435.1 f d$ \tf 1 j k$ d f\te u$ d j 1 j$ [root@rhel7pc1 test]# grep $'\t' test.txt f 1 j k d f e u

浙公网安备 33010602011771号