Ben Chuanlong Du's Blog

And let it direct your passion with reason.

Shell Equivalent in Different Operating Systems

It suggested that you use IPython shell instead of Bash/Zsh shells. Please refer to IPython Is the Best Shell for detailed discussions. If you have to use shell commands, it is suggested that you use Linux commands when possible as Linux command are more universal and useful. You can achieve this by using WSL 2 on Windows and by using Docker or virtual machine on macOS.

OS Command
Set PATH Linux/Unix export PATH=/new/path:$PATH
Windows PowerShell $env:Path += ";.\swigwin-4.0.1";
Get location
of a command
Linux/Unix which command_name
Windows PowerShell Get-command command_name
Windows CMD[1] where command_name
Add user
to a group
Linux sudo gpasswd -a user_name group_name
macOS sudo dseditgroup -o edit -a $username_to_add -t user admin
Windows NA
Compress/Decompress Archives Linux/Unix Compress and Decompressing Archives in Linux
Windows PowerShell Expand-Archive .\swigwin-4.0.1.zip .;
Download a file Linux/Unix curl -sSL http://file.example.com -o output
wget http://file.example.com -O output
Windows PowerShell (New-Object System.Net.WebClient).DownloadFile("http://prdownloads.sourceforge.net/swig/swigwin-4.0.1.zip","swigwin-4.0.1.zip");
Watch a command Linux/Unix watch command_to_watch
Windows Watch for changes with PowerShell
Manage partitions of a disk Linux fdisk
macOS fdisk [2]
Windows fdisk (via WSL 2 or virtual machine)

[1] Windows CMD command might not work well in Windows PowerShell. For example, the where command sometimes works but sometimes doesn't work in a PowerShell. Since PowerShell becomes more popular than Windows CMD, Get-command is recommended over where.

[2] The macOS version of fdisk does not function similar to the Linux version of fdisk. It is not as intuitive and easy to use as the Linux version. It is suggested that you use the Linux version of fdisk instead.

Comments