Thread: Move files in a list...
08-05-2010, 06:10 AM #1Move files in a list...
I hope this is the correct forum to ask my question...
I have to work with a bunch of files but those files are named in a...stupid way. Fortunately I'm able to list all files with certain parameters in a list, but what I want to do now is to move only the files which are mentioned in such a list to another directory.
Is there a bash command which can do this? To move only the files mentioned in a list?
08-05-2010, 08:56 AM #2
Why not move directly without creating a list using wildcards? Would that be a solution?
mv ./*stupid_name*.txt ./folder
08-05-2010, 09:04 AM #3
Well, thats the reason why I ask this question in the first place. The files have different parameters which are not reflected in their names...
say you have files named like this:
but only a subgroup of them belongs together. Its possible for me to create lists of all files with one particular parameter, but not moving them with wildcards because of the filenames...
08-05-2010, 09:10 AM #4
Please give another example of these parameters, I'm thinking no matter how you create that list (if it's with bash) you should be able to use that as the source part for mv.
08-05-2010, 09:27 AM #5
Ok I will stop tormenting you, there is another option. Look at the following script:
for i in `cat list` do mv `echo $i` <destination>/`echo $i` done
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
By jennyald in forum OS X - Operating SystemReplies: 2Last Post: 02-25-2010, 11:02 PM
By liliajams in forum Running Windows (or anything else) on your MacReplies: 3Last Post: 01-07-2010, 04:56 PM
By Banksy in forum OS X - Operating SystemReplies: 1Last Post: 05-25-2009, 02:07 AM
By gagliano3 in forum OS X - Operating SystemReplies: 3Last Post: 05-02-2009, 11:27 PM
By skier19 in forum OS X - Apps and GamesReplies: 2Last Post: 04-02-2008, 02:59 PM