Running Commands in Different Operating Systems¶
Windows (PowerShell)¶
-
Opening PowerShell:
- Press
Win + X
and select "Windows PowerShell" or "Terminal" - OR press
Win + R
, typepowershell
, and press Enter - OR search for "PowerShell" in the Start menu
- Press
-
Navigating directories (if needed):
-
Running commands:
Just paste the command and press Enter. Make sure you know what the command does before running it!
Mac (Terminal)¶
-
Opening Terminal:
- Press
Command + Space
to open Spotlight - Type "Terminal" and press Enter
- OR find Terminal in Applications → Utilities → Terminal
- Press
-
Navigating directories (if needed):
-
Running commands:
Just paste the command and press Enter. Make sure you know what the command does before running it!
Linux (Terminal)¶
-
Opening Terminal:
- Press
Ctrl + Alt + T
(on most distributions) - OR search for "Terminal" in your application menu
- Press
-
Navigating directories (if needed):
-
Running commands:
Just paste the command and press Enter. Make sure you know what the command does before running it!
Common Tips¶
- Use
Tab
for auto-completion of file and folder names - Use
↑
and↓
arrow keys to navigate through command history - Use
Ctrl + C
(Command + C on Mac) to cancel a running command - Use
clear
to clear the terminal screen - Use
pwd
to show your current directory path
Troubleshooting¶
If a command is not found:
- Verify the program is installed
- Check if the program is in your system's PATH
- Try using the full path to the program
- On Windows, you might need to restart PowerShell after installing new programs
For example, if python --version
doesn't work:
- Windows: Try
py --version
or check if Python is in your PATH - Mac/Linux: Try
python3 --version
as many systems use this command instead
Remember: Commands are case-sensitive on Mac and Linux, but not on Windows.