3 ms·Another way: while read line ; do basename "$line" ; done < a.txtby erdbeerkaese 11y agoAnother way: while read line ; do basename "$line" ; done < a.txtwyldfire 11y agoYeah, I think I prefer yours. Probably more robust wrt filenames-with-whitespace too.protomyth 11y agoBoth solutions although nice and helpful pretty much illustrate why I ended up writing a filter capable version.