Shell Shortcuts for Recently Downloaded Files

I often find myself downloading a file in the browser, then switching to the terminal and moving the file into my current working directory, where I do something with it. Often I forget what the file was called, so I have to switch to my browser one more time just to check the filename. This got annoying enough that I wrote some bash shortcuts to help me.

mvdl will move the most recently downloaded file into the current directory. To get the second most recently downloaded file, use mvdl 2. To specify a destination other than the current directory, use mvdl 2 dest.

cpdl is just like mvdl except that it copies the file instead of moving it.

lsdl displays the 10 most recently downloaded files, so that you know what number to supply to mvdl or cpdl.

Here's the full bash snippet to make this work. Let me know if you have suggestions for improvement.