Skip to main content
added 5 characters in body; edited tags
Source Link
Jeff Schaller
  • 68.9k
  • 35
  • 122
  • 268
#!/bin/sh for f in *.png do echo mv -n "$f" "$(date +%Y%m%d-%H-%M-%S)_$f" done 

So I want to rename several filefiles with their timecreated liketimestamp as stated in (ls -lt --full-timels -lt --full-time), but I run when my code above, the name useuses the current date/time or modify time. Only year,month,day I want the year, month, and day in yymmdd format.

#!/bin/sh for f in *.png do echo mv -n "$f" "$(date +%Y%m%d-%H-%M-%S)_$f" done 

So I want rename several file with their timecreated like stated in (ls -lt --full-time), but I run when my code above, the name use the current date/time or modify time. Only year,month,day I want, in yymmdd format

#!/bin/sh for f in *.png do echo mv -n "$f" "$(date +%Y%m%d-%H-%M-%S)_$f" done 

I want to rename several files with their timestamp as stated in (ls -lt --full-time), but I run when my code above, the name uses the current date/time or modify time. I want the year, month, and day in yymmdd format.

Became Hot Network Question
added 44 characters in body
Source Link
#!/bin/sh for f in *.png do echo mv -n "$f" "$(date +%Y%m%d-%H-%M-%S)_$f" done 

So I want rename several file with their timecreated like stated in (ls -lt --full-time), but I run when my code above, the name use the current date/time or modify time. Only year,month,day I want, in yymmdd format

#!/bin/sh for f in *.png do echo mv -n "$f" "$(date +%Y%m%d-%H-%M-%S)_$f" done 

So I want rename several file with their timecreated like stated in (ls -lt --full-time), but I run when my code above, the name use the current date/time or modify time.

#!/bin/sh for f in *.png do echo mv -n "$f" "$(date +%Y%m%d-%H-%M-%S)_$f" done 

So I want rename several file with their timecreated like stated in (ls -lt --full-time), but I run when my code above, the name use the current date/time or modify time. Only year,month,day I want, in yymmdd format

Source Link

How to rename multiple files with the time created?

#!/bin/sh for f in *.png do echo mv -n "$f" "$(date +%Y%m%d-%H-%M-%S)_$f" done 

So I want rename several file with their timecreated like stated in (ls -lt --full-time), but I run when my code above, the name use the current date/time or modify time.