Skip to main content

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 CommandBash
pwdpwd
cd target-directorycd target-directory
lsls
ls -Forcels -al
echo $null > filenametouch filename
mkdir directory-namemkdir directory-name
cat filenamecat filename
cp old-filename new-filenamecp old-filename new-filename
cp -r old-directory new-directorycp -r old-directory new-directory
mv filename new-filenamemv filename new-filename
mv filename existing-foldermv filename existing-folder
mv my-folder existing-foldermv my-folder existing-folder
rm filenamerm filename
rm -Recurse -Force directoryrm -rf directory
psps -ef
ps | findstr process-nameps -ef | grep process-name
kill pidkill -9 pid
man commandman command