D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Updating the time stamp of specific files recursively throughout a directory structure.

 

On Sun, Nov 14, 2010 at 11:54 AM, tom <tompotts@xxxxxxxxxxxxxxxxxxxxxx> wrote:
> On 14/11/10 10:34, Roland Tarver wrote:
>>
>> Hi Folks
>>
>> I am sure this is fairly straight forward. But cant think how to do it....
>>
>> Within a directory structure exist various WAV files (usually lecture
>> recordings). They have a time stamp of 1980. How would I touch all these
>> files? and update the time stamp. I have a list of the paths and
>> filenames in a text file. An example of the file is shown below.
>>
>>
>> /home/roly/uniDocs/lectureRecordings/2ndYear/recordingsToSort/021010-111302.WAV
>>
>> /home/roly/uniDocs/lectureRecordings/2ndYear/recordingsToSort/021010-130029.WAV
>>
>> /home/roly/uniDocs/lectureRecordings/2ndYear/recordingsToSort/021110-094232.WAV
>>
>> /home/roly/uniDocs/lectureRecordings/2ndYear/recordingsToSort/021110-113322.WAV
>>
>> /home/roly/uniDocs/lectureRecordings/2ndYear/recordingsToSort/021110-122522.WAV
>>
>> /home/roly/uniDocs/lectureRecordings/2ndYear/recordingsToSort/021510-092736.WAV
>>
>> /home/roly/uniDocs/lectureRecordings/2ndYear/recordingsToSort/021510-110411.WAV
>>
>> /home/roly/uniDocs/lectureRecordings/2ndYear/recordingsToSort/121009-102551.WAV
>>
>> /home/roly/uniDocs/lectureRecordings/2ndYear/recordingsToSort/drugs/morphine.WAV
>>
>> /home/roly/uniDocs/301AppliedPharmacology/lectureRecordings/110110-091844.WAV
>>
>> /home/roly/uniDocs/301AppliedPharmacology/lectureRecordings/110110-105226.WAV
>>
>> /home/roly/uniDocs/301AppliedPharmacology/lectureRecordings/110110-140655.WAV
>>
>> /home/roly/uniDocs/301AppliedPharmacology/lectureRecordings/110210-091714.WAV
>>
>> /home/roly/uniDocs/301AppliedPharmacology/lectureRecordings/110210-111618.WAV
>>
>> The command would probably need to recursively touch all the WAV files
>> starting from the /home/roly/uniDocs directory. Touch does not seem to
>> support recursion - according to the man page. :-s
>>
>> xargs?
>>
>> Best wishes
>> Many thanks
>>
>> Roly :-)
>>
>>
>
> This is really an RTFM problem but

Actually, i did read the manual for xargs and touch but have never
used find before so would have struggled putting 2 and 2 together. :-p

> From your /home/rolyuniDocs directory:
> find -name *.WAV|xargs touch

Magic, thank you :-)

best wishes
roly

-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq