head, tail, catI(linux) in powershell

powershell提供了get-content命令,这个命令还存在3个别名,分别是gc, cat, type,这4个是等同的。

function head(){
    param(
        [String]$f,
        [int]$n=6
    )

    $cont = cat -TotalCount $n $f
    return $cont
}
head "data.txt"
posted @ 2017-01-14 01:17  乌祁班岚图  阅读(1132)  评论(1编辑  收藏  举报