This question already has an answer here:
In my media center directory all modified times of my folders are somehow not the desired date.
How can I change all modified times of the main folders to the modified time of the newest media-file inside each folder?
cd /tmp mkdir test cd test mkdir d1 mkdir d2 touch d1/text1.txt touch d1/movie1.mov touch d2/text2.txt touch d2/movie2.mov touch notthis.file
now I tried:
ls -td *| head -n 1
but that gives out: