rm doesn't prompt for whether to remove the file :(
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.
rm doesn't prompt for whether to remove the file :(
Hey Folks,
I'm having a slight annoying problem with a new linux box I got - the "rm" command doesn't prompt me whether I wanna remove the file or not - it works as if "--force" is turned on by default..
The man pages say
Quote:
If a file is unwritable, the standard input is a tty, and the -f or --force option is not given, rm prompts the user for whether to remove the file. If the response does not begin with `y' or `Y', the file is skipped.
I've got the same config on 2 boxes I've got but one prompts me when I wanna delete something without --force and one doesn't (unless it isn't writable mode) - anyone has any idea how to change it so that unless I put -f or --force it will ask me? even if the mode is 777
I would suggest checking aliases first. Sometimes the -f flag is added by default to a user's shell profile or RC file.
Run alias from the command line and see if you have an alias for rm. If you do, check your ~/.bash_profile or ~/.bashrc (assuming you use the bash shell) to see if the alias is automatically created in them.
On some distro's, such as Mandrake, there is an aliases script that sets the aliases for all of the users. It is sourced by the /etc/profile script when a user logs in. You can either add an entry to that file, or alter your ~/.bash_login ~/.profile or ~/.bashrc file.
This assumes that you use bash as your default shell. Another shell may have it's own startup script.
Awesome people - that works brilliantly..
I am actually using tsch so it was .cshrc, I added
alias rm 'rm -i'
and it worked perfectly after I logged out and in again..
by the way is there a command to reload .cshrc? or just the aliases? I tried newaliases but that's a postfix command, there's no man page for alias so, is there a way? just out of curiousity really 'cuz logging out and in really seems like not the optimal way of doing it
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.