题目:
题目链接: https://leetcode-cn.com/problems/tenth-line/
解题思路:
head + tail组合,或者awk的NR参数
SHELL:
# awk方法
awk '{if (NR == 10) print $0}' file.txt
# head + tail
head -10 file.txt | tail -n +10 | tail -1
题目链接: https://leetcode-cn.com/problems/tenth-line/
head + tail组合,或者awk的NR参数
# awk方法
awk '{if (NR == 10) print $0}' file.txt
# head + tail
head -10 file.txt | tail -n +10 | tail -1