1.获取第k行(以k=10为例) 要注意的是,如果文件包含内容不足10行,应该不输出. # Read from the file file.txt and output the tenth line to stdout. # 解法一,使用awk awk 'NR == 10' file.txt # 解法二,使用sed(个人测试结果:sed方法比awk快) sed -n '10p' file.txt # 解法三,组合使用tail与head file.txt | head -n1 # 另外,以下这种方
grep -nr 'archermind' -r, --recursive Read all files under each directory, recursively, following symbolic links only if they are on the command line. This is equivalent to the -d recurse option. -n, --line-number Prefix each line of output with the