I'd like to do something like this to move the last two downloaded files:mv ` ls -rt ~/Downloads/ | tail -2 ` .Unfortunately, ls only gives the filenames. How can I adapt the code above?(Before someone points it out, I'm aware of the problems in piping the output of ls. I'd only use this when I know the filenames in question.)
How to get the relative paths with ls?
linux;bash;ls