What is the command to delete a file in linux terminal
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
yes trevelluk........i just interested to know the clear difference between rmdir and rm -r. thank you very much friend.
you may also have observed that i referred deltree from windows.
get your point clearly. you mean to say rm -r is exactly similar to deltree (in windows). and rmdir is similar to rmdir or rd (in windows/dos). am i correct?
now the million doller question is that.......do i have to confirm with "y/n" option if i use rm -r (as we have to in dos) or it directly remove all the contents with the directory without any warning?
OK, I'm not really that familiar with DOS commands. It's been a long time since I've been near the things
Regarding confirmation: rm -r will delete most files without any need for confirmation. If one of the files isn't writeable, you will be prompted. To automatically delete this as well without prompting, use rm -rf
For more info, type man rm (man <command>) will display the electronic manual page for that command. This is your friend
Well, rm could ask confirmation or not, it depends on the distribution, I think. Tested several of them, in some cases the user profiles are created with an alias to rm, so it asks for confirmation every time, while in others it doesn't.
Personally, I create the alias in such a way that rm asks me. If i don't want to be bothered, just run "\rm ...".
About the differences with rmdir, I think this does not removes the directory unless it is empty. I don't know if there is a parameter like -f for rm to force the action.
Thank you friends for your suggestions. I have learnt a lot from your discussions. I am a newbie and that is why my questions are like newbies. If I get into another problem I shall be asking all your help in the forum. Thank you again.