I have a path in unix /aaa/trial/<xxx>.
means it has
<xxx> is a folder which will change for each extract produced and it is an increasing integer number.
I want to find the recent xxx folder
You should be able to ls | sort | tail -1.
ls | sort | tail -1
DIR /OG /O-D /B - the most recent folder will be listed first.
DIR /OG /O-D /B
3 years ago
1 year ago