このエントリーをはてなブックマークに追加


PowerShell、コマンドプロンプト、Linuxコマンド対応表

PowerShellに対応するコマンドプロンプト(DOS)コマンド, Linuxコマンドの一覧表を記します。 良く使用すると思われるコマンドレットの一覧になります。


コマンドレット対応表

NoセクションPowerShellコマンドプロンプトLinux
1ファイル・ディレクトリ関連Get-ChildItemdirls, dir
2Get-ChildItem -Namedir /bls -1
3Get-ChildItem | Where-Object {$_.Attribute -eq "Directory"}
Get-ChildItem | Where-Object { $_.PSIsContainer }
dir /adls -F | grep /
4Get-ChildItem | Sort-Object LastWriteTimedir /odls -ltr
5Get-ChildItem | Sort-Object LastWriteTime -Descendingdir /o-dls -lt
6Get-Contenttypecat
7Copy-Itemcopycp
8Copy-Item -Recursexcopy
robocopy
cp -r
9Remove-Itemdel
erase
rm
10Move-Itemmovemv
11Rename-Itemrenmv
12Get-ChildItem -Recurse -Namedir /b /sfind .
13(Get-Content 対象ファイル名 | Measure-Object).Countfind /c /v ""wc -l
14Get-Locationcd
chdir
pwd
15New-Item -ItemType Directorymk
mkdir
mkdir
16Set-Locationcd
chdir
cd
17Remove-Itemrd
rmdir
rmdir
18Compare-Object (Get-Content ファイル名) (Get-Content ファイル名)fcdiff
19robocopyrsync
20New-item -ItemType File ファイル名type null > ファイル名touch
21(Get-Item ファイル名).LastWriteTime = (Get-Date)copy ファイル名 +touch
22プロセスGet-Processtasklistps
23Stop-Processtaskkillkill
24Get-Process | Where-Object ($_.ProcessName -eq "プロセス名") | % { Stop-Process $_.Id }taskkill /imkillall
25文字列操作Select-String -CaseSensitivefindstrgrep
26Select-Stringfindstr /igrep -i
27Get-Content ファイル名 | Sort-Objectsortsort
28Get-Content ファイル名 | Sort-Object | Get-Unique-sort | uniq
29文字列.Replace("置換前文字列", "置換後文字列")
-tr
30日付・時刻Get-Date -Format yyyy/MM/dddate /t
echo %DATE%
date '+%Y/%m/%d'
31Get-Date -Format hh:mm:sstime /t
echo %TIME%
date '+%T'
32システム[Environment]::OSVersionver
winver
systeminfo | findstr /b "OS"
uname -a
33Get-WMIObject Win32_Processor | Format-Listsysteminfocat /proc/cpuinfo
34Get-WMIObject Win32_PhysicalMemory | Format-Listsysteminfocat /proc/meminfo
35-logmansar
36-logmanvmstat
37-logmaniostat
38Get-Help コマンドレットコマンド /?man
39hostnamehostname
40taskmgrtop
41環境・シェル関連Exit-PSSessionexitexit
42Get-ChildItem env:setenv
43Get-ChildItem env:setprintenv
44Write-Hostechoecho
45Clear-Hostclsclear
46Set-Alias
New-Alias
doskey 別名=コマンドalias
47Get-History-history
48Get-Random%RANDOM%$RANDOM
49Get-Commandwherewhich
50$lastexitcode%ERRORLEVEL%$?
51$PID-$$
52ユーザquery user
query user /server:ホスト名
who -u
53whoamiwho am i
54ネットワークipconfig /aifconfig -a
55netstatnetstat
56arparp
57pingping
58tracerttraceroute
59nslookupnslookup
60その他$NULLNUL/dev/null
61Start-Sleeptimeout /t 秒 /nobreak > nulsleep


トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2016-01-16 (土) 13:26:17