Windows has a shell OS which is CMD.EXE and Powershell. However, some linux command does not work on the windows command line. The windows powershell and CMD has different commands (and some of the same) with Bash, Zsh and other Unix-based shells. Thankfully, there are some Unix-based solution for windows, some of the most popular one’s are the Git-bash and WSL (Windows Subsystem for Linux). You can download and install any of them.
- Speed
- Easy to access remote servers
- Command line tools
- Great skill to have
Arrow Up
andArrow Down
: This will show your previous and next commandsTab
: This will auto-complete yourCtrl + C
: This will exit the current commandCtrl + D
: This will close the terminal. Note: this command does not work onCommand line
andPowershell
exit
: This will close the terminal on windowscommand line
andpowershell
help
: This will show you many more options
Some of the commands here works well on Bash and ZSH but does not work on cmd
and powershell
. I will try to write out all the commands and show the difference
- On windows command line and powershell
dir
- On Bash and Zsh
ls
- Creating a folder is the same across all platform
mkdir [folderName]
- While, creating a file is different. On windows
type nul > [filename.extention]
- On Bash and Zsh
touch [filename.extention]
Navigating through folders is the same across all the platform
- To navigate into a folder
cd [foldername]
- To go back to the previous folder
cd ..
- This command works on windows
cls
- This command works on bash and zsh
clear
- On windows
rename [file] [newfilename] rename [folder] [newfoldername]
- On Bash and Zsh
mv [folder] [newfoldername] mv [file] [newfilename]
- On windows
xcopy [filetype] [folder]
- On Bash and Zsh
cp [filetype] [foldername]
- On windows
move [filetype] [folder]
- On Bash and Zsh
mv [filetype] [folder]
- On Bash and Zsh
rm [filename.extention] rm -r [folder]
- On windows
del [filename.extention] rmdir [folder]
- On windows
ren [oldfilename] [newfilename] ren [oldfoldername] [newfoldername]
- On Bash and Zsh
mv [oldfilename] [newfilename] mv [oldfoldername] [newfoldername]
- Practice the commands here
- Use google to discover new commands