# Copy, Move & Remove — Linux

Source: https://www.geekswithgeeks.com/en/linux/linux-copy-move-remove

> cp, mv and rm — and the caution rm deserves.

## cp — copy

`cp source dest` copies a file. Add `-r` to copy a directory recursively.

```bash
cp notes.txt notes-backup.txt
cp -r projects projects-backup
```

## mv — move or rename

`mv` moves a file, or renames it if the destination is in the same directory.

```bash
mv notes.txt archive/
mv oldname.txt newname.txt
```

## rm has no undo

`rm file` deletes permanently — no trash bin. `rm -r dir` deletes a directory and its contents. Use `rm -i` to confirm each deletion while you're still building confidence.
