rm -i option?

Asked by Lethe

I went to set up an alias 'rm -i' in .bashrc so I get confirmation of file removal, but when sourcing it, an error occurs - no such option.

Sure enough:

nick@palantir:~$ rm -i dead.letter
Usage: command-not-found [options] <command-name>

command-not-found: error: no such option: -i
bash: -i: command not found

According to man page (and any other GNU/Linux I have used):

 -i, --interactive
              prompt before any removal

Where has this option GONE??

Nick

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Lethe
Solved:
Last query:
Last reply:
Revision history for this message
Jigho (jigho) said :
#1

try the following :
\rm -i dead.letter

If it works, that means that you already have an alias over rm (\rm call rm whatever the aliases)

Revision history for this message
Lethe (nick-ukfsn) said :
#2

Thanks, yep that does indeed work as expected.

Also calling /bin/rm -i works.

So then, having looked everywhere, where does 'rm' get aliased?

nick@palantir:~$ which rm
/bin/rm

nick@palantir:~$ file /bin/rm
/bin/rm: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.0, dynamically linked (uses shared libs), stripped

There is nothing in $HOME/.bashrc, /etc/bash.bashrc, /etc/profile

I am lost...

Nick

Revision history for this message
Lethe (nick-ukfsn) said :
#3

OK, doing a:

unalias rm

fixes it up.

Now the hunt to where it gets aliased first time around. I am at a loss now - I have looked everywhere.

Nick

Revision history for this message
Lethe (nick-ukfsn) said :
#4

Urghhhhhhhhh

My fault. I had aliased in .bashrc as:

alias rm= 'rm -i'

Bloody space after =. unalias fixed it up... (of course).

Sorry for the noise.

Nick