Description: Description of the problem 【】
Tail command to print a document in the last n lines.
Command format is: tail [-n] filename, of which:
-n: n, said the number of rows need to print, when n is omitted the value of 10.
filename: the given file name.
For example, the command tail-20 example.txt print documents that example.txt the last 20 lines, using C language realization of the program. (Hint: Use the command-line parameters)
】 【Input form
tail [-n] filename, in which:-n: n, said the number of rows need to print, when n is omitted the value of 10.
filename: the given file name.
】 【Output form
Print document filename of the last n lines
】 【Input sample
Command: tail-2 tail.in
tail.in the content of the document as follows:
Alcatel provides end-to-end solutions.
It enables enterprises to deliver content to any type of user.
lcatel operates in 130 countries.
Alcatel focus on optimizing their service offerings and revenue streams.
【Output sample】
Screen
To Search:
File list (Check if you may need any files):
tail.c
新建文本文档.txt