modified head and tai compatible with cmd input as -noOfLinesl