!/bin/bash
tail -5 nowcoder.txt
#或
tail -n 5 nowcoder.txt

看到题目要求,就知道,使用tail和head就可以了

tail和head常用语法

tail 文件名 
# 默认显示文件后10行
tail -n 文件名
# 显示文件后n行head 文件名 默认显示文件前10行
head -n 文件名
# 显示文件前n行