#navi(../)

* Linuxコマンド・コマンドプロンプト(DOS)・PowerShellコマンド比較・対応表 [#d72f6cd9]
よく使われると思われるコマンドの比較表・対応表を作成しました。~~
対象となるのは、Linux, コマンドプロンプト, PowerShellの3つを記述しています。
#contents
#htmlinsertpcsp(linux_ads_top.html,linux-sp.html)

* コマンド比較・対応表 [#qfc9d6dd]

|''No''|''セクション''|''Linux''|''コマンドプロンプト''|''PowerShell''|
|1|ファイル・ディレクトリ関連|ls, dir|dir|Get-ChildItem|
|2||ls -1|dir /b|Get-ChildItem -Name|
|3||ls -F | grep /|dir /ad|Get-ChildItem | Where-Object {$_.Attribute -eq "Directory"}&br;Get-ChildItem  | Where-Object { $_.PSIsContainer }|
|4||ls -ltr|dir /od|Get-ChildItem | Sort-Object LastWriteTime|
|5||ls -lt|dir /o-d|Get-ChildItem | Sort-Object LastWriteTime -Descending|
|6||cat|type|Get-Content|
|7||cp|copy|Copy-Item|
|8||cp -r|xcopy&br;robocopy|Copy-Item -Recurse|
|9||rm|del&br;erase|Remove-Item|
|10||mv|move|Move-Item|
|11||mv|ren|Rename-Item|
|12||find .|dir /b /s|Get-ChildItem -Recurse -Name|
|13||wc -l|find /c /v ""|(Get-Content 対象ファイル名 | Measure-Object).Count|
|14||pwd|cd&br;chdir|Get-Location|
|15||mkdir|mk&br;mkdir|New-Item -ItemType Directory|
|16||cd|cd&br;chdir|Set-Location|
|17||rmdir|rd&br;rmdir|Remove-Item|
|18||diff|fc|Compare-Object (Get-Content ファイル名) (Get-Content ファイル名)|
|19||rsync|robocopy|←|
|20||touch|type null > ファイル名|New-item -ItemType File ファイル名|
|21||touch|copy ファイル名 +|(Get-Item ファイル名).LastWriteTime = (Get-Date)|
|22|プロセス|ps|tasklist|Get-Process|
|23||kill|taskkill|Stop-Process|
|24||killall|taskkill /im|Get-Process | Where-Object ($_.ProcessName -eq "プロセス名") | % { Stop-Process $_.Id }|
|25|文字列操作|grep|findstr|Select-String -CaseSensitive|
|26||grep -i|findstr /i|Select-String|
|27||sort|sort|Get-Content ファイル名 | Sort-Object|
|28||sort | uniq|-|Get-Content ファイル名 | Sort-Object | Get-Unique|
|29||tr|-|文字列.Replace("置換前文字列", "置換後文字列")&br;|
|30|日付・時刻|date '+%Y/%m/%d'|date /t&br;echo %DATE%|Get-Date -Format yyyy/MM/dd|
|31||date '+%T'|time /t&br;echo %TIME%|Get-Date -Format hh:mm:ss|
|32|システム|uname -a|ver&br;winver&br;systeminfo | findstr /b "OS"|[Environment]::OSVersion|
|33||cat /proc/cpuinfo|systeminfo|Get-WMIObject Win32_Processor | Format-List|
|34||cat /proc/meminfo|systeminfo|Get-WMIObject Win32_PhysicalMemory | Format-List|
|35||sar|logman|-|
|36||vmstat|logman|-|
|37||iostat|logman|-|
|38||man|コマンド /?|Get-Help コマンドレット|
|39||hostname|hostname|←|
|40||top|taskmgr|←|
|41|環境・シェル関連|exit|exit|Exit-PSSession|
|42||env|set|Get-ChildItem env:|
|43||printenv|set|Get-ChildItem env:|
|44||echo|echo|Write-Host|
|45||clear|cls|Clear-Host|
|46||alias|doskey 別名=コマンド|Set-Alias&br;New-Alias|
|47||history|-|Get-History|
|48||$RANDOM|%RANDOM%|Get-Random|
|49||which|where|Get-Command|
|50||$?|%ERRORLEVEL%|$lastexitcode|
|51||$$|-|$PID|
|52|ユーザ|who -u|query user&br;query user /server:ホスト名|←|
|53||who am i|whoami|←|
|54|ネットワーク|ifconfig -a|ipconfig /a|←|
|55||netstat|netstat|←|
|56||arp|arp|←|
|57||ping|ping|←|
|58||traceroute|tracert|←|
|59||nslookup|nslookup|←|
|60|その他|/dev/null|NUL|$NULL|
|61||sleep|timeout /t 秒 /nobreak > nul|Start-Sleep|

#htmlinsertpcsp(linux_ads_btm.html,linux-sp.html)

トップ   編集 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS