let suppose I have folders with names af32, af42, af, and I want to print the last modification date of all folders whose have af* pattern for example . I writed shell that will take folder or files as parameter and return modification date for that folder .
stat -c %y "$1"
this code will return the last modification date to folder . but how can I apply this code to more than one folder whose have same pattern in their name
ll -lt | grep af
you can try this – neferpitou Jun 06 '18 at 13:58ls af*
; do stat -c %y; done – Josef Klimuk Jun 06 '18 at 14:16