Unix: How to select every 1,000th line from a file