-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial revision of the oldest trick in the book
- Loading branch information
Showing
1 changed file
with
13 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |