LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-06-2006, 12:48 AM   #1
Buto
Member
 
Registered: Sep 2004
Location: So Cal
Distribution: Slackware 12
Posts: 60

Rep: Reputation: 16
Editing time on files


In one of my directories I have some pictures and I want to know how to edit a certain block of files without having to manually type in each name.

For example I have files IMG_001.jpg all the way up to IMG_150.jpg all in one directory. How do I just edit the time files for images IMG_034.jpg to IMG_062.jpg.

I tried using
Code:
touch -t MMDDHHMM IMG_[034-062]*
. But that didnt seem to do the trick.
 
Old 09-06-2006, 02:11 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

This should work:

touch -t MMDDHHMM IMG_03[4-9]* IMG_0[45]* IMG_06[0-2]*

As you can see you need 3 parts, one for the 032-039 range, one for the 04*/05* range and one for the 060-062 range. I don't think you can combine these three into one regexp (or if it is, it's going to be un-readable).

Hope this helps.
 
Old 09-06-2006, 09:54 AM   #3
Buto
Member
 
Registered: Sep 2004
Location: So Cal
Distribution: Slackware 12
Posts: 60

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by druuna
Hi,

This should work:

touch -t MMDDHHMM IMG_03[4-9]* IMG_0[45]* IMG_06[0-2]*

As you can see you need 3 parts, one for the 032-039 range, one for the 04*/05* range and one for the 060-062 range. I don't think you can combine these three into one regexp (or if it is, it's going to be un-readable).

Hope this helps.
I'll try this once I can. Thanks Druuna.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
editing files ballistic509 Debian 5 03-24-2006 06:13 AM
Editing default module parameters at boot time icpsvt Linux - General 3 02-11-2006 07:03 PM
Help with editing files BajaNick Linux - General 6 06-13-2004 12:53 AM
Editing files nicomon Linux - General 3 12-02-2002 10:43 PM
re: editing files malbowges Linux - Newbie 1 04-30-2002 07:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:36 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