commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
Downloads the entire file, but http servers don't always provide the optional 'Content-Length:' header, and ftp/gopher/dict/etc servers don't provide a filesize header at all.
There are 13 alternatives - vote for the best!
- Where $URL is the URL of the file.
- Replace the $2 by $3 at the end to get a human-readable size.
Credits to svanberg @ ArchLinux forums for original idea.
Edit: Replaced command with better version by FRUiT. (removed unnecessary grep)
If you can do better, submit your command here.
You must be signed in to comment.