11.04中grep ^问题
发表于 : 2011-09-12 14:58
http://linux-vbird.bluedata.org/linux_b ... ularex.htm
例题三、行首与行尾字符 ^ $:
我们在例题一当中,可以查询到一行字符串里面有 the 的,那如果我想要让 the 只在行首列出呢? 这个时候就得要使用定位字符了!我们可以这样做:[root@test root]# grep -n '^the' regular_express.txt
12:the symbol '*' is represented as start.
可是我用grep -n '^the' regular_express.txt,却出不来结果。
有谁可以帮忙试试?
例题三、行首与行尾字符 ^ $:
我们在例题一当中,可以查询到一行字符串里面有 the 的,那如果我想要让 the 只在行首列出呢? 这个时候就得要使用定位字符了!我们可以这样做:[root@test root]# grep -n '^the' regular_express.txt
12:the symbol '*' is represented as start.
可是我用grep -n '^the' regular_express.txt,却出不来结果。
有谁可以帮忙试试?