Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then 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.
i've mistyped while issuing the command rm -rf and instead of doing rm -rf * i used $.
now i have a big problem cause i can't use any commands like ls,cat,...
operating system: debian lenny
could you please help me out
EDIT:
weird thing is i have 2 terminals open to my server. On the one i issued the rm command it <<mod edit: "does not work correctly">>
but on the other one i can do all commands.
i'm not going to close my putty
greetings
Last edited by pixellany; 04-16-2010 at 08:24 AM.
Reason: language cleanup
I'm not aware of a $ on it's own having any special meaning in the shell, so I'm not sure exactly what you might have done here except for trying to recursively remove the file '$'.
What happens if you open a new 3rd terminal to the server? Does that one work?
apperently rm -rf $ only damages the session your in cause after restarting all my putty terminals i found that there wasn't a problem anymore.
i wonder what it acctually does that command
As I said above, '$' on it's own has no special meaning to the shell so the rm -rf $ would have searched to find a file called '$' to delete, and there's unlikely to be one of that name.
Perhaps something else untoward happened to your current shell environment. Anyway, glad you suffered no real damage.
Just on the subject of this, one to be very wary of is using shell variables with rm -rf. I know a guy who had many variables set up, $HOME, $MUSIC, $TMPFILES etc, pointing to various places...
So, he intended to delete say everything in $TMPFILES but he accidentally issued the following command: rm -rf $TMP_FILES/* as root!! I'm sure you can imagine the end result. oops! ($TMP_FILES was uninitialized).
haha. Thankfully it wasn't me and the person who did it was on a test system which didn't really matter if it was trashed. Had it been a production system I think it might have been a different story!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.