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!
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.
Hi. I promise I am carefully studying shell use, and much else, but right now I just need the shell instruction to search directories recursively, for files with .swo & .swp extensions, deleting the files as they're found. Thanks!
find / -name '*.swo' -print (This command will show you all the files with the extension .swo). Once verified use the below command (same command with -delete option) to delete the files with that extension. I am suggesting you to run this command first to make sure that it is printing the files that you are intending to delete and there is nothing else getting deleted if the command ran with -delete option.
Two more questions: how do I exclude one file from delete? Also, I overlooked one file before I deleted it. I'm not sure if I need it: /root/.swo Do I need that? If so how can I restore it? Thanks.
Check out the man page for find:
# man find
I think there is an exclude option in there that supports file patterns. Also, /root/.swo doesn't ring a bell as a necessary file. As for the last question, if you delete a file there is no (easy) way to recover without some low level tools to perform recovery (which I don't know much about unfortunately).
So be very careful on your deletes ...
Also, what does your post have to do with SSH support? For better responses, make sure your post title is related to your actual issue ...
Last edited by sandwormusmc; 06-28-2011 at 04:23 PM.
Sorry. I meant, "Help! I need to use shell via SSH," but we're supposed to avoid titles including "help," so I used "support." I figured I could infer that I will be using SSH by including it in the title. See, there is some method to my madness.
Try to use titles that reflect the actual qn; ssh is redundant in this case, its a 'find' qn.
As for restore; depends what you mean. You should be doing backups regularly. If in doubt with a cmd like this, copy the relevant files somewhere else before deleting them, just in case.
For emergencies there are a few things you can try, starting with photorec, but use the LQ Search facility for the many threads on this subject.