How to convert any date to YYYYMMDDHHMMSS
using unix shell script?
It is not specific date it may any date. how to convert it?
example date format is: 20110101050603
Thanks Puspa
How to convert any date to YYYYMMDDHHMMSS
using unix shell script?
It is not specific date it may any date. how to convert it?
example date format is: 20110101050603
Thanks Puspa
Output :-
More on Dates
Note this only works on GNU date.
I have read that:
Update:-
Use
ls
command to find all files and usegrep
command for all files.grep
command also accepts regular expression.But it won't validate your file accurate. For example, if a file name is
20151835101010
, then it will validate this file. But actually month and date both are wrong.So my suggestion is to write a shell script to identify valid file name and find oldest of them by processing one by one.