Computing.Net > Forums > Unix > Check for filenames and Move

Check for filenames and Move

Reply to Message Icon

Original Message
Name: anilcgowda
Date: September 22, 2005 at 11:05:36 Pacific
Subject: Check for filenames and Move
OS: UNIX
CPU/Ram: 1GB
Comment:

Hi,

I have the filenames of few files in a file(filenames.txt). The actual files are in one directory(Source). What I need to do is, check for the files in the filename.txt. If those files are present in that directory(Source), move them to another directory(Target).

Something like:
if filename exists in filename.txt
then mv Souredir/filename Targetdir.

Can anyone please help me in achieving this.

Thanks,
Anil


Report Offensive Message For Removal


Response Number 1
Name: nails
Date: September 23, 2005 at 07:33:16 Pacific
Subject: Check for filenames and Move
Reply: (edit)

which shell are you using?


Report Offensive Follow Up For Removal

Response Number 2
Name: anilcgowda
Date: September 25, 2005 at 16:52:10 Pacific
Subject: Check for filenames and Move
Reply: (edit)

I got the solution nails. Thanks.
I'm getting each filename from the filenames file and moving it one at a time using a while loop.


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Check for filenames and Move

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software