UNIX系コマンド群との対応

ls

コマンドレット

 get-child-item
 gci
 dir
 ls

find

コマンドレット

 gci -Recurse -Filter "*.txt"                                                             # 1
 gci -Recurse | where { $_.LastWriteTime -gt "2013-02-01" }                               # 2
 gci -Recurse | where { $_.CreationTime -gt (Get-Date).AddDays(-3) } | Select-Object name # 3
  • #1 ファイル名の末尾が.txtのファイル
  • #2 2/1以降のファイル
  • #3 3日前までに作られたファイルのファイル名のみ

grep

コマンドレット

 Select-String
 sls

使用例

 sls "taro" user.txt
 netstat -n | Out-String -Stream | sls "192.168."

詳細

touch (ファイル作成)

 New-Item -Type file foo.txt
 ni -type file foo.txt

which

 Get-Command vi | ft Definition
 Definition                      
 ----------                      
 C:\Users\taro\App\vim\vim.exe

トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS