Shell Function to Download File
Tired of trying to remember the flags and parameter order for curl
or wget
? Use this quick function in your bash profile:
function download {
$(which curl) -o ${1##*/} $1
}
Usage: download http://raw.github.com/someproject/master/somefile.js
Downloads somefile.js
to the current directory.
Credit to jacedominiak for suggesting a function instead of a script.
Written by Jason Seney
Related protips
2 Responses

could be done as a shell function as well, one file less to maintain:
function download {
$(which curl) -o ${1##*/} $1
}
over 1 year ago
·

@jacedominiak - Yes, you're right, much better in a function, thanks!
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Script
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#