I often find myself in situations where I want to download a file from the command-line using tools such as wget. While there are many reasons to doing so, today I needed to do it due to the size of the file and the fact that I needed it on a webserver of mine. So instead of downloading it first to my desktop and then uploading it to my server, I wanted to simply download the file directly from my webserver via the command-line.
I quite often want to / have to leech all files of a certain type from a website. The best way to do this is by using wget. The following command will download all files of type mp3 from a website:
wget -r -l1 -t1 -nd -N -np -A.mp3 http://example.com/mymp3s
Do this from within the folder where you want to download the files to.
This is actually more for my own record so that I don't have to man and google next time, but I'll try and explain all the switches when I'm motivated to do so :)