🐚 Bash + Claude Code Cheat Sheet 🤖

Interactive command reference for developers

GREP — Find Text in Files

grep "pattern" file.txt

Search for "pattern" in file.txt

grep -i "pattern" file.txt

Case-insensitive search

grep -v "pattern" file.txt

Show lines that don't match

grep -r "pattern" folder/

Recursive search in folder

Common Bash Commands

ls

List files and folders

cd folder/

Change directory

pwd

Show current directory

mkdir new_folder

Make a new folder

rm file.txt

Delete a file

cat file.txt

Print file contents

Claude Code + WSL

wsl

Start WSL Linux environment

code .

Open current folder in VS Code

git clone <url>

Clone a GitHub repo

npm start

Start a Node.js app

Extended Bash Commands

chmod +x file.sh

Make script executable

ps aux

List all processes

df -h

Show disk space

tar -czvf archive.tar.gz folder/

Create compressed archive

curl http://url.com

Fetch content from URL

top

Live process monitor

Useful Bash Patterns

# Pipe output to grep
ls -l | grep ".txt"

# Count lines with a match
grep -c "error" logfile.txt

# Save command output to a file
ls > list.txt

# Append output to a file
echo "New entry" >> notes.txt

PATH & Environment Variables

echo $PATH

Show your current PATH

export PATH=$PATH:/new/path

Add directory to PATH

export VAR_NAME="value"

Create environment variable

echo $VAR_NAME

Access variable value

💡 Tip: Add environment variables to ~/.bashrc or ~/.bash_profile to make them permanent.

Command copied!