Part 0: Setting Up Your Environment
Table of Contents
Get your Linux command-line environment ready for the workshop Before we dive into the workshop, let’s get your environment set up! This guide will walk you through installing everything you need, regardless of your operating system. This tutorial is written for Bash (the most common Linux shell). If you’re using Zsh (default on macOS Catalina+), don’t worry—almost everything will work identically! The main differences you might notice are in advanced customization ( WSL lets you run a full Linux environment directly on Windows. It’s the best way to learn Linux commands on a Windows machine. WSL Ubuntu can be installed via the Microsoft store as well, but installing it via powershell is recommended. Open PowerShell as Administrator (Right-click Start → Windows PowerShell (Admin)) and run: This command will: Restart your computer when prompted. After restart, search for and launch ubuntu through windows search. It will ask you to create a new user: Important: Once Ubuntu is set up, run these commands: This updates all packages to their latest versions. Let’s install You should see a beautiful display of your system information! You can open WSL in several ways: Access Windows files: Your Windows drives are mounted at Access WSL files from Windows: Type Copy/Paste: macOS comes with a Unix-based terminal, so you’re already halfway there! We’ll install Homebrew, the package manager for macOS. Open Terminal (⌘+Space, type “Terminal”) and run: Follow the on-screen instructions. After installation completes, read the “Next steps” section carefully—it will tell you the exact commands to run. For Apple Silicon Macs (M1-M4), run: For Intel Macs, run: Not sure which Mac you have? Click the Apple Menu → About This Mac. If it says ‘Chip: Apple M1/M2/M3/M4’, you have Apple Silicon. If it says ‘Processor: Intel’, you have an Intel Mac. Close and reopen Terminal for changes to take effect. You should see the Homebrew version number. You should see your Mac system info! Your shell: macOS Catalina+ uses Access your files: Your home folder is at If you’re already on Linux, you’re all set! Here are the common package managers for popular distributions: Not sure which one you have? Try: Install neofetch to test: Let’s make sure everything works! Run these commands: If all these commands work, you’re ready to go! “WSL command not found”: “This operation requires elevation”: Ubuntu doesn’t launch after restart: “Command not found” after installing: “Permission denied”: “E: Could not get lock”: “Permission denied”: Now that your environment is set up, you’re ready to start learning! Your checklist: Ready to begin? Let’s dive into the actual command-line skills! Having issues? Drop a comment below or check the WSL documentation / Homebrew documentation.Navigation
.zshrc vs .bashrc), but we’ll point those out when relevant.Windows Users: Installing WSL (Windows Subsystem for Linux)
Prerequisites
Step 1: Enable WSL
wsl --install ubuntuStep 2: Set Up Ubuntu
Enter new UNIX username: yourusername
New password: ********
Retype new password: ********sudo commandsStep 3: Update Your System
sudo apt update
sudo apt upgrade -yStep 4: Verify Installation
neofetch to test everything:sudo apt install neofetch -y
neofetchAccessing WSL
wsl in PowerShell or Command PromptWSL Tips
/mnt/:cd /mnt/c/Users/YourName/Desktop\\wsl$ in File ExplorermacOS Users: Installing Homebrew
Step 1: Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"echo 'eval "$(/usr/local/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/usr/local/bin/brew shellenv)"Step 2: Verify Installation
brew --versionStep 3: Test with neofetch
brew install neofetch
neofetchmacOS Tips
zsh by default (which is great! We’ll customize it later)~/ or /Users/YourName/Linux Users: Package Managers
Debian/Ubuntu/Linux Mint
sudo apt update
sudo apt install package-nameFedora/RHEL/CentOS
sudo dnf install package-name
# Or on older versions:
sudo yum install package-nameArch Linux/Manjaro
sudo pacman -S package-nameopenSUSE
sudo zypper install package-nameAlpine Linux
sudo apk add package-nameCheck Your Package Manager
# Check if apt exists
which apt
# Check if dnf exists
which dnf
# Check if pacman exists
which pacmanVerify Installation
# Debian/Ubuntu
sudo apt install neofetch
# Fedora
sudo dnf install neofetch
# Arch
sudo pacman -S neofetch
# Then run it:
neofetchTesting Your Environment
# Check your shell
echo $SHELL
# Check your home directory
cd ~
pwd
# List files
ls -la
# Create a test file
echo "Hello, Linux!" > test.txt
cat test.txt
rm test.txt
# Check for basic tools
which git
which curl
which vimTroubleshooting
WSL Issues
wsl in PowerShellHomebrew Issues
echo command to add Homebrew to your PATHsudo with Homebrew commandsLinux Issues
sudo for system-wide installationsWhat’s Next?
neofetch showing system infoQuick Reference
# WSL (Windows)
wsl --install # Install WSL
sudo apt update # Update packages
sudo apt install neofetch # Install a package
# macOS
brew install neofetch # Install a package
brew update # Update Homebrew
# Linux (Debian/Ubuntu)
sudo apt install neofetch # Install a package
sudo apt update # Update package list