LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Script to change date/time (https://www.linuxquestions.org/questions/linux-newbie-8/script-to-change-date-time-4175517134/)

Torquemalex 09-02-2014 03:57 AM

Script to change date/time
 
Hi everybody!
I need to perform a task with a script but I have no idea how to do it, I hope someone could help me:
- on my linux pc I have many folders with movies, tv shows, toons, ecc.
They are shared by a dlna server to my panasonic tv where I can browse and see them.
The problem is that they are sorted with date/time only and there's no way on the TV or on the dlna server to change the sort method to alphabetical.
What I need is a script that changes date/time (no matter to when, but every file should be 1 min or 1 hour or one day more than the previous) according to the alphabetical order, within each subdirectory of a master path.
Can you please help me?

Thanks in advance and best regards!

Alex

syg00 09-02-2014 05:25 AM

The "date" command accepts a user specified date/time, and converts it as you wish. See the manpage. Here is an example
Code:

date -d "01 jan 2010 00:02" +%F_%T
Use some variables, and increment in a loop - use that to rename your files.

Torquemalex 09-02-2014 05:31 AM

Quote:

Originally Posted by syg00 (Post 5231108)
The "date" command accepts a user specified date/time, and converts it as you wish. See the manpage. Here is an example
Code:

date -d "01 jan 2010 00:02" +%F_%T
Use some variables, and increment in a loop - use that to rename your files.

I don't want to rename the files, I need to change their date/time.

syg00 09-02-2014 05:38 AM

"man touch"


All times are GMT -5. The time now is 07:31 AM.