仅排序文件的前100行

Geo*_*loa 2 unix sorting shell terminal

我有一个名为"mywords"的文本文件,其中包含此信息

  A
  A's
  AA's
  AB's
  ABM's
  ...
Run Code Online (Sandbox Code Playgroud)

它有1000行,我想只排序前100行.其余的线应保持不变.只有一列单词.如何使用unix命令执行此操作?

小智 5

(head -100 mywords|sort;tail -n +101 mywords) > mywords.100sorted
Run Code Online (Sandbox Code Playgroud)