Skip to content

Instantly share code, notes, and snippets.

@yanhua365
Created October 11, 2014 02:15
Show Gist options
  • Save yanhua365/ed56f5099473f3767cb0 to your computer and use it in GitHub Desktop.
Save yanhua365/ed56f5099473f3767cb0 to your computer and use it in GitHub Desktop.
读取大文件的前几行的命令
#这样的速度快
sed -n '10,20p' test.txt
#用cat配合head或tail也可以,但大文件会内存溢出
cat test.txt|head -n 30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment