LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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


Reply
  Search this Thread
Old 12-12-2013, 07:26 PM   #1
littlejoe5
Member
 
Registered: Aug 2006
Location: Arizona
Distribution: ubuntu dirivatives mostly Mate
Posts: 260

Rep: Reputation: 19
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....?
 
Old 12-13-2013, 09:12 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,717

Rep: Reputation: 8169Reputation: 8169Reputation: 8169Reputation: 8169Reputation: 8169Reputation: 8169Reputation: 8169Reputation: 8169Reputation: 8169Reputation: 8169Reputation: 8169
Quote:
Originally Posted by littlejoe5 View Post
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.
Old 04-05-2014, 08:37 AM   #3
littlejoe5
Member
 
Registered: Aug 2006
Location: Arizona
Distribution: ubuntu dirivatives mostly Mate
Posts: 260

Original Poster
Rep: Reputation: 19
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Scratch Disk Full Solaris 10. Cant Delete or Move Files donanap Solaris / OpenSolaris 6 10-26-2018 04:41 AM
[SOLVED] Extremely slow to move files to trash and/or delete files permanently... CT_0000 Linux - Newbie 2 01-09-2014 10:06 AM
Delete/move/copy files of specific date imsajjadali Red Hat 26 11-07-2013 11:34 PM
Can upload and download but cannot move and delete files in vsftpd SarahGurung Linux - Server 7 06-21-2013 03:50 AM
[SOLVED] Script to move/delete aged files ankitpandey Linux - General 6 01-27-2012 09:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration