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


Linuxコマンド・コマンドプロンプト(DOS)・PowerShellコマンド比較・対応表

よく使われると思われるコマンドの比較表・対応表を作成しました。~
対象となるのは、Linux, コマンドプロンプト, PowerShellの3つを記述しています。


コマンド比較・対応表

NoセクションLinuxコマンドプロンプトPowerShell
1ファイル・ディレクトリ関連ls, dirdirGet-ChildItem
2ls -1dir /bGet-ChildItem -Name
3ls -F | grep /dir /adGet-ChildItem | Where-Object {$_.Attribute -eq "Directory"}
Get-ChildItem | Where-Object { $_.PSIsContainer }
4ls -ltrdir /odGet-ChildItem | Sort-Object LastWriteTime
5ls -ltdir /o-dGet-ChildItem | Sort-Object LastWriteTime -Descending
6cattypeGet-Content
7cpcopyCopy-Item
8cp -rxcopy
robocopy
Copy-Item -Recurse
9rmdel
erase
Remove-Item
10mvmoveMove-Item
11mvrenRename-Item
12find .dir /b /sGet-ChildItem -Recurse -Name
13wc -lfind /c /v ""(Get-Content 対象ファイル名 | Measure-Object).Count
14pwdcd
chdir
Get-Location
15mkdirmk
mkdir
New-Item -ItemType Directory
16cdcd
chdir
Set-Location
17rmdirrd
rmdir
Remove-Item
18difffcCompare-Object (Get-Content ファイル名) (Get-Content ファイル名)
19rsyncrobocopy
20touchtype null > ファイル名New-item -ItemType File ファイル名
21touchcopy ファイル名 +(Get-Item ファイル名).LastWriteTime = (Get-Date)
22プロセスpstasklistGet-Process
23killtaskkillStop-Process
24killalltaskkill /imGet-Process | Where-Object ($_.ProcessName -eq "プロセス名") | % { Stop-Process $_.Id }
25文字列操作grepfindstrSelect-String -CaseSensitive
26grep -ifindstr /iSelect-String
27sortsortGet-Content ファイル名 | Sort-Object
28sort | uniq-Get-Content ファイル名 | Sort-Object | Get-Unique
29tr-文字列.Replace("置換前文字列", "置換後文字列")
30日付・時刻date '+%Y/%m/%d'date /t
echo %DATE%
Get-Date -Format yyyy/MM/dd
31date '+%T'time /t
echo %TIME%
Get-Date -Format hh:mm:ss
32システムuname -aver
winver
systeminfo | findstr /b "OS"
[Environment]::OSVersion
33cat /proc/cpuinfosysteminfoGet-WMIObject Win32_Processor | Format-List
34cat /proc/meminfosysteminfoGet-WMIObject Win32_PhysicalMemory | Format-List
35sarlogman-
36vmstatlogman-
37iostatlogman-
38manコマンド /?Get-Help コマンドレット
39hostnamehostname
40toptaskmgr
41環境・シェル関連exitexitExit-PSSession
42envsetGet-ChildItem env:
43printenvsetGet-ChildItem env:
44echoechoWrite-Host
45clearclsClear-Host
46aliasdoskey 別名=コマンドSet-Alias
New-Alias
47history-Get-History
48$RANDOM%RANDOM%Get-Random
49whichwhereGet-Command
50$?%ERRORLEVEL%$lastexitcode
51$$-$PID
52ユーザwho -uquery user
query user /server:ホスト名
53who am iwhoami
54ネットワークifconfig -aipconfig /a
55netstatnetstat
56arparp
57pingping
58traceroutetracert
59nslookupnslookup
60その他/dev/nullNUL$NULL
61sleeptimeout /t 秒 /nobreak > nulStart-Sleep


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