题目:
Given a text file file.txt, print just the 10th line of the file.
给定一个txt档,印出里面的第十行
这......其实就在考我们认不认识awk或sed吧
sed:
sed -n "10p" file.txt
-n表唯读,但遇到p指令所以印出第十行
最后执行时间35ms(faster than 89.27%)
awk:
awk 'NR==10' file.txt
NR表第几组资料,我们要第10行所以==10
最后执行时间32ms(faster than 94.25%)
那我们下题见