cheatsheet/wsl-ubuntu-exercise.md

81 lines
1.2 KiB
Markdown

# WSL / Ubuntu Exercise — "My First Project"
**Goal:** Create a project folder, add files, edit them, and explore.
**Time:** ~10 minutes
---
### Step 1 — Create a folder and go inside
```bash
mkdir my-project
cd my-project
```
### Step 2 — Create a file with some text
```bash
echo "Hello from WSL!" > hello.txt
```
Now look at what's in the folder:
```bash
ls
```
### Step 3 — View the file
```bash
cat hello.txt
```
### Step 4 — Edit the file
```bash
nano hello.txt
```
Inside nano:
- Add a new line (e.g. `Today I am learning Linux commands.`)
- Save: **Ctrl + O**, then **Enter**
- Exit: **Ctrl + X**
### Step 5 — See your changes
```bash
cat hello.txt
```
### Step 6 — Create a backup folder and copy the file
```bash
mkdir backup
cp hello.txt backup/
ls backup/
```
### Step 7 — List everything in detail
```bash
ls -la
```
Notice the file sizes, dates, and permissions.
### Step 8 — Clean up (go back home)
```bash
cd ~
```
---
**Commands you used:** `mkdir`, `cd`, `echo`, `ls`, `cat`, `nano`, `cp`, `ls -la`
**What you learned:**
- Creating and navigating folders
- Creating, viewing, and editing files
- Copying files and listing details