Skip to content

Commit

Permalink
Initial revision of the oldest trick in the book
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasbn committed Aug 9, 2024
1 parent c59e6d3 commit 14097f0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions rm/are_you_sure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Are You Sure?

This might be the oldest trick I learned when I started using `rm` and `mv` on the command line on Linux ages ago.

The trick is to use the `-i` option to `rm` and `mv` to make sure you are not deleting or moving the wrong files.

```bash
alias rm='rm -i'
```

By creating an alias for `rm` you will be prompted for confirmation before deleting files, since the alias will let `rm` be replaced by `rm -i` which prompts for confirmation.

The same pattern can be used for other commands and simple as it is it can be a lifesaver.

0 comments on commit 14097f0

Please sign in to comment.