PowerShell command equivalent of Bash commands
As a veteran Ubuntu
user, I use Command Line
all the time. Recently I need to teach a course with more emphasis of PowerShell
.
It makes me realize that PowerShell
has a lot of commands that could correspond to their counterpart in Bash
.
Here is a one to one mapping table you can refer to.
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 |