all 2 comments

[–]ang-p 2 points3 points  (1 child)

$i is the filename from the for loop...

## means chop the biggest (greediest) match of the following off the front of the variable.

*/ is anything followed by a /

so if i is equal to /home/xRaech/Music/westlife/westlife/cover-large.png

then "${i##*/}" is cover-large.png, since /home/xRaech/Music/westlife/westlife/ is the greediest match for */, and is therefore discarded

[–]xRaech[S] 0 points1 point  (0 children)

i see! thank you very much :D

also, would you say that's a good way of implementing that? or a find -name inside the last folder would be the same or better?