[bash] find printf seconds
Code:
find -type f -printf '%TY-%Tm-%Td %TH:%TM:%TS\t%f\n' %TS gives me seconds followed by decimal digits: 2010-12-29 20:50:57.0000000000 <name> Is there any way to just get 2 digits other than piping the find output through sed? |
find -exec ls -l --time-style
Code:
# find -exec ls -l --time-style='+%H:%M:%S' {} + Code:
# man ls EXAMPLE Code:
# find -exec ls -l --time-style='+%H:%M:%S' {} + |
Or
Code:
find -type f -printf '%TY-%Tm-%Td %TH:%TM:%.2TS\t%f\n' Code:
find -type f -printf '%Tc\t%f\n' |
ntubski - brilliant!
Where are those formatting options documented? |
|
All times are GMT -5. The time now is 12:11 AM. |