# Include warning to shell when user runs dangerous command

**URL:** <https://forum.endeavouros.com/t/include-warning-to-shell-when-user-runs-dangerous-command/69140>\
**Category:** EndeavourOS repo\
**Created:** [March 17, 2025, 1:33am UTC](https://forum.endeavouros.com/t/include-warning-to-shell-when-user-runs-dangerous-command/69140 "2025-03-17T01:33:42Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![willy\_wonka\_28](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/w/e9bcb4/32.png) [@willy\_wonka\_28](https://forum.endeavouros.com/u/willy_wonka_28)\
**Post date:** [March 17, 2025, 1:33am UTC](https://forum.endeavouros.com/t/include-warning-to-shell-when-user-runs-dangerous-command/69140/1 "2025-03-17T01:33:42Z")

</div>

The other day I came very close to wiping my system after entering `rm -rf /*` in the terminal. I’m pretty sure that some individuals have also ran into this too. Maybe some weren’t even as fortunate as me and suffered serious casualties after.

Can we have some kinda clear warning pop up before the command runs?

Like a `This command would wipe your entire system. Proceed: yes/no`

---

<div class="post-metadata">

**Author:** ![cactux](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/cactux/32/134907_2.png) [@cactux](https://forum.endeavouros.com/u/cactux)\
**Post date:** [March 17, 2025, 2:01am UTC](https://forum.endeavouros.com/t/include-warning-to-shell-when-user-runs-dangerous-command/69140/2 "2025-03-17T02:01:02Z")

</div>

> [@willy\_wonka\_28](#):
>
> The other day I came very close to wiping my system after entering `rm -rf /*` in the terminal.

What was your intention of running that command? What did you want to accomplish? What did you think it will do? Where did you get that command? Who told you to run it?

> [@willy\_wonka\_28](#):
>
> Maybe some weren’t even as fortunate as me and suffered serious casualties after.

What happened? What did stop you?

---

<div class="post-metadata">

**Author:** ![Bink](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/bink/32/87216_2.png) [@Bink](https://forum.endeavouros.com/u/Bink)\
**Post date:** [March 17, 2025, 2:11am UTC](https://forum.endeavouros.com/t/include-warning-to-shell-when-user-runs-dangerous-command/69140/3 "2025-03-17T02:11:33Z")

</div>

I just ran it, and don’t advise others try 😆

It was on a snapshotted VM of course, so no issue. Whilst without `sudo` it did nothing to system areas, it totalled my home folder and no doubt any other area not requiring `sudo`.

---

<div class="post-metadata">

**Author:** ![Bink](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/bink/32/87216_2.png) [@Bink](https://forum.endeavouros.com/u/Bink)\
**Post date:** [March 17, 2025, 2:23am UTC](https://forum.endeavouros.com/t/include-warning-to-shell-when-user-runs-dangerous-command/69140/4 "2025-03-17T02:23:10Z")

</div>

I wouldn’t necesarily be opposed to a warning, you know, something like:

```bash
$ rm -rf /*
Attempting to delete entire system...
Are you out of your Vulkan mind?! yes/[no]

```

Having accidentally trashed my `/bin` folder in the past, I _hopefully_ learned my lesson… but it can be a hard one to have to learn and potentially devastating in personal folders get involved.

Oh, and welcome to the community @willy_wonka_28 👋 😎 :enos_flag:

---

<div class="post-metadata">

**Author:** ![cactux](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/cactux/32/134907_2.png) [@cactux](https://forum.endeavouros.com/u/cactux)\
**Post date:** [March 17, 2025, 2:25am UTC](https://forum.endeavouros.com/t/include-warning-to-shell-when-user-runs-dangerous-command/69140/5 "2025-03-17T02:25:28Z")

</div>

Why not running it with sudo while you had the chance 😆

---

<div class="post-metadata">

**Author:** ![eznix](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/eznix/32/2043_2.png) [@eznix](https://forum.endeavouros.com/u/eznix)\
**Post date:** [March 17, 2025, 4:21am UTC](https://forum.endeavouros.com/t/include-warning-to-shell-when-user-runs-dangerous-command/69140/6 "2025-03-17T04:21:45Z")

</div>

> [@willy\_wonka\_28](#):
>
> Can we have some kinda clear warning pop up before the command runs?
> 
> Like a `This command would wipe your entire system. Proceed: yes/no`

Where would the fun be in that? Seriously, how do people learn if they don’t touch the stove? Live and learn, and then you know what not to do.

---

<div class="post-metadata">

**Author:** ![manfredlotz](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/manfredlotz/32/56126_2.png) [@manfredlotz](https://forum.endeavouros.com/u/manfredlotz)\
**Post date:** [March 17, 2025, 4:42am UTC](https://forum.endeavouros.com/t/include-warning-to-shell-when-user-runs-dangerous-command/69140/7 "2025-03-17T04:42:43Z")

</div>

`rm` has two parameters that might help you

```auto
-i prompt before every removal
-I prompt once before removing more than three files, or when removing recursively; less intrusive than -i, while still giving protection against most mistakes

```

So, if you want to use `-I` you could define an alias

```auto
alias rm=`rm -I`

```

in `bash`

---

<div class="post-metadata">

**Author:** ![manfredlotz](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/manfredlotz/32/56126_2.png) [@manfredlotz](https://forum.endeavouros.com/u/manfredlotz)\
**Post date:** [March 17, 2025, 4:45am UTC](https://forum.endeavouros.com/t/include-warning-to-shell-when-user-runs-dangerous-command/69140/8 "2025-03-17T04:45:18Z")

</div>

I never tested it but there is even an AUR package `safe-rm` for this.

---

<div class="post-metadata">

**Author:** ![thefrog](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/thefrog/32/114250_2.png) [@thefrog](https://forum.endeavouros.com/u/thefrog)\
**Post date:** [March 17, 2025, 8:11am UTC](https://forum.endeavouros.com/t/include-warning-to-shell-when-user-runs-dangerous-command/69140/9 "2025-03-17T08:11:37Z")

</div>

> [@willy\_wonka\_28](#):
>
> close to wiping my system after entering `rm -rf /*` in the terminal. I’m pretty sure that some individuals have also ran into this too. Maybe some weren’t even as fortunate as me and suffered serious casualties after.

as pointed out there is a interaction function in RM that can easily be added to your bashrc file.

Yes we have all suffered the misfortune of typing in a command and it destroying something we didn’t want it to. Right after we LEARNED very quickly that we need to JUST PAY ATTENTION.

This is why its important to have backups.

---

<div class="post-metadata">

**Author:** ![dbarronoss](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/d/f4b2a3/32.png) [@dbarronoss](https://forum.endeavouros.com/u/dbarronoss)\
**Post date:** [March 17, 2025, 8:17am UTC](https://forum.endeavouros.com/t/include-warning-to-shell-when-user-runs-dangerous-command/69140/10 "2025-03-17T08:17:37Z")

</div>

Exactly (JUST PAY ATTENTION), I certainly don’t want my system to start 'Are you sure?'ing me.

---

<div class="post-metadata">

**Author:** ![thefrog](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/thefrog/32/114250_2.png) [@thefrog](https://forum.endeavouros.com/u/thefrog)\
**Post date:** [March 17, 2025, 8:19am UTC](https://forum.endeavouros.com/t/include-warning-to-shell-when-user-runs-dangerous-command/69140/11 "2025-03-17T08:19:11Z")

</div>

Had a system like that they called it Windows. I deleted that garbage immediately 🤣

---

<div class="post-metadata">

**Author:** ![willy\_wonka\_28](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/w/e9bcb4/32.png) [@willy\_wonka\_28](https://forum.endeavouros.com/u/willy_wonka_28)\
**Post date:** [March 17, 2025, 9:37am UTC](https://forum.endeavouros.com/t/include-warning-to-shell-when-user-runs-dangerous-command/69140/12 "2025-03-17T09:37:22Z")

</div>

😅 It was a mistake on my path…was trying to delete all the files in a directory. I realized something was wrong when I started reading the error messages in my terminal.

---

<div class="post-metadata">

**Author:** ![willy\_wonka\_28](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/w/e9bcb4/32.png) [@willy\_wonka\_28](https://forum.endeavouros.com/u/willy_wonka_28)\
**Post date:** [March 17, 2025, 9:39am UTC](https://forum.endeavouros.com/t/include-warning-to-shell-when-user-runs-dangerous-command/69140/13 "2025-03-17T09:39:07Z")

</div>

Thanks for the welcome Bink! It’s been nice using endeavour os for sometime…Windows was out to take my ancient computer’s life.

---

<div class="post-metadata">

**Author:** ![willy\_wonka\_28](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/w/e9bcb4/32.png) [@willy\_wonka\_28](https://forum.endeavouros.com/u/willy_wonka_28)\
**Post date:** [March 17, 2025, 9:40am UTC](https://forum.endeavouros.com/t/include-warning-to-shell-when-user-runs-dangerous-command/69140/14 "2025-03-17T09:40:18Z")

</div>

thanks for this.

---

<div class="post-metadata">

**Author:** ![manuel](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/manuel/32/396_2.png) [@manuel](https://forum.endeavouros.com/u/manuel)\
**Post date:** [March 17, 2025, 1:22pm UTC](https://forum.endeavouros.com/t/include-warning-to-shell-when-user-runs-dangerous-command/69140/15 "2025-03-17T13:22:20Z")

</div>

Welcome!

Please note that `rm` is not the only command that can cause issues. For example, `cp` and `mv` can have the potential to create nasty problems. Option `-i` can try prevent accidents with those commands.

Many other commands (like partition managers and `dd`) have the potential for disasters too.

Tools like `safe-rm` _might_ be useful to some extent, but as already implied here, it is best to _be aware_ and _be careful_.

---

<div class="post-metadata">

**Author:** ![dbarronoss](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/d/f4b2a3/32.png) [@dbarronoss](https://forum.endeavouros.com/u/dbarronoss)\
**Post date:** [March 17, 2025, 1:29pm UTC](https://forum.endeavouros.com/t/include-warning-to-shell-when-user-runs-dangerous-command/69140/16 "2025-03-17T13:29:05Z")

</div>

Manuel, never forget the most dangerous of all, dd. It still bites me on occasion when I’m not being careful _hahaa_, but I thought that was the correct device name for my flash drive..oops!

---

<div class="post-metadata">

**Author:** ![cactux](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/cactux/32/134907_2.png) [@cactux](https://forum.endeavouros.com/u/cactux)\
**Post date:** [March 17, 2025, 1:30pm UTC](https://forum.endeavouros.com/t/include-warning-to-shell-when-user-runs-dangerous-command/69140/17 "2025-03-17T13:30:20Z")

</div>

Use your `sudo` wisely and cautiously!  
With great power comes great responsibility. And that responsibility is yours only.

---

<div class="post-metadata">

**Author:** ![dalto](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/dalto/32/5577_2.png) [@dalto](https://forum.endeavouros.com/u/dalto)\
**Post date:** [March 17, 2025, 2:11pm UTC](https://forum.endeavouros.com/t/include-warning-to-shell-when-user-runs-dangerous-command/69140/19 "2025-03-17T14:11:40Z")

</div>

Thanks for the suggestion!

I think this is a good idea but probably not that practical.

The biggest problem would be coming up with a list of dangerous commands that we could all agree on. Something I feel would be a dangerous command someone else might disagree with.

Additionally, given the makeup of our userbase, I think many would find this type of warning to be intrusive.

---

<div class="post-metadata">

**Author:** ![dbarronoss](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/d/f4b2a3/32.png) [@dbarronoss](https://forum.endeavouros.com/u/dbarronoss)\
**Post date:** [March 17, 2025, 2:14pm UTC](https://forum.endeavouros.com/t/include-warning-to-shell-when-user-runs-dangerous-command/69140/20 "2025-03-17T14:14:09Z")

</div>

And frankly, you can do great damage with _cat_ if you put your mind to it.  
Well and running with root privilege, I guess anything…

---

<div class="post-metadata">

**Author:** ![xircon](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/xircon/32/9124_2.png) [@xircon](https://forum.endeavouros.com/u/xircon)\
**Post date:** [March 17, 2025, 2:22pm UTC](https://forum.endeavouros.com/t/include-warning-to-shell-when-user-runs-dangerous-command/69140/21 "2025-03-17T14:22:04Z")

</div>

Cat - I agree, lost two keys to the claws of mine 🤣

I use the trash-cli package, which protects from _some_ things, but I doubt would stop a full blown attack of idiocy (we have all done something similar) - the only real solution is good backups.

[Next page](https://forum.endeavouros.com/t/include-warning-to-shell-when-user-runs-dangerous-command/69140.md?page=2)
