195. Tenth Line leetcode bash

来源:互联网 发布:cf手机版刷枪软件下载 编辑:程序博客网 时间:2024/06/06 01:33

How would you print just the 10th line of a file?

For example, assume that file.txt has the following content:

Line 1Line 2Line 3Line 4Line 5Line 6Line 7Line 8Line 9Line 10
Your script should output the tenth line, which is:
Line 10

[show hint]

Have you met this question in a real interview? 
Yes
 
No

Discuss


# Read from the file file.txt and output the tenth line to stdout.sed -n 10p file.txt


0 0