PowerShell與Bash相對應之Command
筆者是一個Command Line
使用者,亦是一個Ubuntu
使用者,因此對bash
了然於心,但近來由於教學而需要,用多了PowerShell
,發覺其實現今之PowerShell
與Bash
已是八成相似。
以下是一個對照表,對照常用的PowerShell
與Bash
之command
,作日後參考之用。
PowerShell Command | Bash |
---|---|
pwd | pwd |
cd target-directory | cd target-directory |
ls | ls |
ls -Force | ls -al |
echo $null > filename | touch filename |
mkdir directory-name | mkdir directory-name |
cat filename | cat filename |
cp old-filename new-filename | cp old-filename new-filename |
cp -r old-directory new-directory | cp -r old-directory new-directory |
mv filename new-filename | mv filename new-filename |
mv filename existing-folder | mv filename existing-folder |
mv my-folder existing-folder | mv my-folder existing-folder |
rm filename | rm filename |
rm -Recurse -Force directory | rm -rf directory |
ps | ps -ef |
ps | findstr process-name | ps -ef | grep process-name |
kill pid | kill -9 pid |
man command | man command |