coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Feature Request: Removal of '-f' Short Option in 'rm' Command


From: Kaz Kylheku
Subject: Re: Feature Request: Removal of '-f' Short Option in 'rm' Command
Date: Thu, 28 Sep 2023 21:18:57 -0700
User-agent: Roundcube Webmail/1.4.13

On 2023-09-24 23:12, Owen Chia wrote:
> Specifically, I would like to suggest the removal
> of the '-f' short option, while retaining
> the '--force' long option.

What are you going to do to fix the three billion,
two-hundred and thirty-seven million,
seven-hundred and fifty-six thousand,
nine-hundred and three scripts (including makefiles)
which use "rm -f"?

Pardon me, nine-hundred and nineteen; sixteen more were
just written since I started writing that number.
 
> The rationale behind this proposal stems from
> the observation that the '-f' short option has led to
> numerous accidental deletions due to its ease of
> use and associated muscle memory.

Ideas:

Replace your rm command by a shell function which filters
out the -f option (but not --force), then calls the
real command.

Replace your rm command by a shell function which asks
you a random skill-testing question if you use --force,
and also to close your eyes, stretch out your right arm
and then touch your nose; as well as walk in a straight
line.

Replace your rm command by a shell function which
sleeps for 15 seconds and then does the remove, or
at least when -f is used, so if you hit Ctrl-C within
that time, nothing happened yet. Maybe your problem
is that you're too hurried!

Replace your rm command by a look-alike that stages
removed files and directories through a recycle bin,
from which they can easily be recovered.

Set up editor backups.

Set up actual backups.

Use git, so at most you lose uncommitted changes
to files, not entire files.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]