例如
Oct 23 06:41:49 localhost init: Starting pid 2452, console /dev/tty1: '/sbin/getty'
Oct 23 06:41:49 localhost init: Starting pid 2451, console /dev/ttyS0: '/sbin/getty'
Oct 23 06:41:49 localhost init: Starting pid 2454, console /dev/tty3: '/sbin/getty'
Oct 23 06:41:49 localhost init: Starting pid 2453, console /dev/tty2: '/sbin/getty'
Oct 23 06:41:49 localhost init: Starting pid 2455, console /dev/tty4: '/sbin/getty'
这样一个文件,输入Starting pid 2455可以查找出最后一行。我想应该是一个有关字符串的函数把,但是不知道用哪个?求教了!谢谢额!