Results 1 to 8 of 8
Hi all,
I am not exactly a newbie, but I face what may be a simple problem. Though, I really do not understand what's going on.
I cannot use the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 07-15-2012 #1Just Joined!
- Join Date
- Jul 2012
- Posts
- 5
command 'rm' doesn't work anymore
Hi all,
I am not exactly a newbie, but I face what may be a simple problem. Though, I really do not understand what's going on.
I cannot use the 'rm' command to delete files anymore. When I try, I get the following message:
mv: missing destination file operand after `/home/name/trash/.'
It looks like an alias was set somewhere. However, I do not remember setting any such thing and the problem appeared all of suden. I tried to check what was called with:
$> which rm
it gives:
alias rm='rm -i'
/bin/rm
I checked and /bin/rm looks like the original one, not a user-defined script.
Full example:
$> touch foo
$> ls -l foo
-rw-rw-r-- 1 name name 0 Jul 15 15:01 foo
$> rm foo
mv: missing destination file operand after `/home/name/trash/.'
Try `mv --help' for more information.
Same happends with rm -f, I really have no way to delete files. I can cp, mv without problems. rm works normally as root. The (not) funny thing is that it happens on my account on a computing grid of which I'm the administrator, so I feel a bit stupid...
Any suggestions welcome!
- 07-15-2012 #2
You are not passing file name in your alias.
Check the file .bashrc in your home directory and if the alias is there, change it toCode:alias rm='rm -i $1'
If we hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate! (Zapp Brannigan)
My new blog. It's probably not as good as I think it is.
The Fifth Continent reborn
- 07-15-2012 #3Just Joined!
- Join Date
- Jul 2012
- Posts
- 5
Does not work. I am pretty sure the alias is correct as it is (it has been like this since a long time working well), but anyway I tried what you suggested.
After modification and log out/log in, I checked the alias was updated with:
$> alias
which gives among other lines: "alias rm='rm -i $1' "
However, the output when I try to use 'rm' is still the exact same as before...
- 07-15-2012 #4Does /home/name/trash exist?Code:
mv: missing destination file operand after `/home/name/trash/.
I do not respond to private messages asking for Linux help, Please keep it on the forums only.
All new users please read this.** Forum FAQS. ** Adopt an unanswered post.
I'd rather be lost at the lake than found at home.
- 07-15-2012 #5Just Joined!
- Join Date
- Jul 2012
- Posts
- 5
It did exist (which really make me think rm is having this behavior "on purpose"), I deleted it (as root), still the same.
- 07-15-2012 #6Just Joined!
- Join Date
- Jul 2012
- Posts
- 5
I got it!
I had the following in my .bashrc:
function rm()
{
mv $1 ~/trash/.
}
Probably I wrote this years ago and uncommented it by mistakes few days ago.
Well, I guess it's a good point in favour of alias instead of functions: it seems that you can overwrite some commands with a function and there is no way to find it later appart than finding it yourself in .bash* files.
Anyway, thank you!
- 07-15-2012 #7
Glad you got it sorted and thanks for posting your solution. Feel free to mark this thread as solved, from the top of this thread under "Thread tools".
I do not respond to private messages asking for Linux help, Please keep it on the forums only.
All new users please read this.** Forum FAQS. ** Adopt an unanswered post.
I'd rather be lost at the lake than found at home.
- 07-16-2012 #8Just Joined!
- Join Date
- Jul 2012
- Posts
- 5
I found a way to get some information on commands, if I knew it before I could have avoid searching for hours:
$> type -a <command>
gives many info, both for alias and functions. Good to know.



