Usage: python tail.py [OPTION] [FILE]
Print the last 10 lines of each FILE to standard output.
With more than one FILE, precede each with a header giving the file name.
Mandatory arguments to long options are mandatory for short options too:
-h, –help display this help and exit
-n, –lines=K output the last K lines, instead of the last 10; or use -n +K to output starting with the Kth line
Note: when executed in Unix-like system, users can run as the unix command style:
$ mv tail.py tail
$ chmod +x tail
$ ./tail [OPTION] [FILE]
代码请参见:Github
Jupyter Notebook 请参见:nbviewer