The file in the link is the manual that Professor mentioned in his lecture today.


It contains Unix commands for some simple text processing tasks, including

  • Counting the number of words in a text file
  • Sorting a list of words in various ways
  • Compute ngram stats
  • Making a concordance 

It won't be necessary to learn all the commands in the manual, but it would be nice to know the basics of grep, sed etc. 


Some other simple commands that might come in handy:

  • head -n <text file>: For when the text file is too big to open in your text editor (which usually happens when the size > 5~10 MB) , but you still want to get an idea of what's inside. This shows the first n lines in the text file.
  • tail -n <text file>: Similar to "head" but shows the last n lines instead.
  • less <text file>: Shows the content of the text file in chunks. Press the space key to "scroll", and press "q" to exit.
  • wc -l <text file>: shows the number of lines in a text file.



最後修改: 2022年 09月 22日(週四) 18:01