Linux - Software This 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. |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
12-12-2013, 07:26 PM
|
#1
|
Member
Registered: Aug 2006
Location: Arizona
Distribution: ubuntu dirivatives mostly Mate
Posts: 260
Rep:
|
I need a script to delete or move scattered files
I'm slowly learning a little about cli. here's the gateway to my most recent project:
I keep changing distros, and experimenting, mostly in the realm od Debian derivatives. Right now I have five distros on my desktop, All of them are either Ubuntu or Mint ranging from mint10 to mint16., and I still have the home directories of several previous distros. Scattred over all of them I have stories and writings at various stages of development. (I'm not very orderly, But the computer knows where they are.)
I just recenly discovered mlocate, and am learning how to use it. It's very easy to do a search for a keyword, and then using 'cut-and-paste' with nano, to put those complete pathnames into a list inside a text file.
Now (with a lot of help) I have written or adapted several small ascripts, but I'm badly out of my element here. There are several things I'd like to do with those file lists.
For instance one list to delete; another to move all those scattered (but related) files, (renaming if needed to avoid over-writing) to a common directrory.
Any guidance about a really simple and throrough tutorial, or sample scripts I can start with, or....?
|
|
|
12-13-2013, 09:12 AM
|
#2
|
LQ Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,717
|
Quote:
Originally Posted by littlejoe5
I'm slowly learning a little about cli. here's the gateway to my most recent project:
I keep changing distros, and experimenting, mostly in the realm od Debian derivatives. Right now I have five distros on my desktop, All of them are either Ubuntu or Mint ranging from mint10 to mint16., and I still have the home directories of several previous distros. Scattred over all of them I have stories and writings at various stages of development. (I'm not very orderly, But the computer knows where they are.)
I just recenly discovered mlocate, and am learning how to use it. It's very easy to do a search for a keyword, and then using 'cut-and-paste' with nano, to put those complete pathnames into a list inside a text file. Now (with a lot of help) I have written or adapted several small ascripts, but I'm badly out of my element here. There are several things I'd like to do with those file lists.
For instance one list to delete; another to move all those scattered (but related) files, (renaming if needed to avoid over-writing) to a common directrory.
Any guidance about a really simple and throrough tutorial, or sample scripts I can start with, or....?
|
We will be glad to help you...so post what you've written/tried so far, and tell us where you're stuck. And there are THOUSANDS of very easily-found scripting tutorials that Google can point you...including one in my posting signature, and many that are already here on LQ (use the search function).
http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html
http://www.tldp.org/LDP/abs/html/
There are also many easily-found scripts to move files based on different criteria.
|
|
1 members found this post helpful.
|
04-05-2014, 08:37 AM
|
#3
|
Member
Registered: Aug 2006
Location: Arizona
Distribution: ubuntu dirivatives mostly Mate
Posts: 260
Original Poster
Rep:
|
Sorry to be so sloww markingthis s solved. Don'tknow that it's really possible to "solve" such a vague question,but your tutorials are a great help to me. Thanks.
|
|
|
All times are GMT -5. The time now is 03:40 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|