PowerShell equivalent for “head -n-3”?
问题 I've been able to track down basic head/tail functionality: head -10 myfile <==> cat myfile | select -first 10 tail -10 myfile <==> cat myfile | select -last 10 But if I want to list all lines except the last three or all lines except the first three, how do you do that? In Unix, I could do "head -n-3" or "tail -n+4". It is not obvious how this should be done for PowerShell. 回答1: Like the -First and -Last parameters, there is also a -Skip parameter that will help. It is worth noting that