# Creating Files & Directories — Linux Command Line Fundamentals

Source: https://www.skillbyai.com/en/linux/linux-file-creation

> Create files and nested directories with touch and mkdir -p, and handle names with spaces.

## touch & mkdir

`touch` creates an empty file (or updates its timestamp). `mkdir` creates a directory.

```bash
touch notes.txt
mkdir projects
ls
```

Output:

```
notes.txt  projects
```

## Nested directories

`mkdir -p` creates parent directories as needed, without erroring if they already exist.

```bash
mkdir -p projects/app/src
ls -R projects
```

Output:

```
projects:
app

projects/app:
src
```

## Avoid spaces & special chars

File names with spaces need quotes or escaping: `touch "my file.txt"` or `touch my\ file.txt`. Prefer hyphens or underscores instead.
