Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
What is the question? it just appears that 'rm' has an alias for "rm -i".
to verify this just type alias at your $ prompt. this sounds like a RH or a fork there of system. RH has the -i set for several options, rm is one of them.
Like jpollard said, you have an alias created that forces rm to execute 'rm -i' or 'rm -I' (where -i comes from interactive)
You can do 'rm -rf --interactive=never text.txt' to suppress the confirmation or reset the alias (search for it in ~/.bashrc or add 'unalias rm' to ~/.bashrc)
However, be very careful when using -rf options.. Don't use them if you really, really don't have to..
it is a SAFETY measure
are you REALLY 100% SURE !!! that you want to do something that is NOT UNDOABLE
you can NOT go back and undo this so it is asking are YOU SURE !!!
and you really DO NOT !!!! want to remove that alias
it is there to PROTECT YOU !!!! FROM A TYPO !!!!
without it you can do this and REALLY FUBAR your install
I need your help for whenever user trying to use rm -rf command system need to confirm like below.
# rm -rf text.txt
Are you sure [Y/n]
Please let me know if anyone knows this.
B. R.
Abdul
I think I read this differently than others.
To me it seems that you are saying that it does NOT offer the confirmation, and you are saying that "system need to confirm like below".
If that is the case then do not use the -f option. The -f option explicitly tells it to NOT confirm. If you want it to confirm anyway, even with -f you can alias rm -rf to rm -ri.
It means rm has been aliased to 'rm -i'. You can just specify the actual cmd
Code:
alias r='rm -i'
r t.t
rm: remove regular empty file `t.t'?
.
.
which rm
/bin/rm
/bin/rm t.t
Note that in the 2nd case it doesn't ask for confirmation ...
The alias may be in the user's .bashrc, or it may be in one of the global files /etc/bashrc.
Personally I always remove the alias; I've been doing this a loonngg time and it just gets in the way. Of course it does mean I have to be careful aka use at your own risk.
i have tried below command in .bashrc and its working fine but after removing the same from .bashrc again its asking confirmation, so how to revert old level.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.