Finding out a file's size before intiating an expensive download
With super-fast connectivity, we often download gigabytes before
realizing that a file is bigger than our budget. To find out that size of the
download, install curl and gawk. Then fill a local file sizer.sh with th
following commands (it really works):
#! /usr/bin/env bash
Echo –n “Enter full download URL (ctrl-shift-V
to paste):”
Read FULLURL; RET=0
While [[RET –eq 0]]; do
LEN=$(curl –Ls –head $FULLURL | grep –I “Content-
Length” | tail -1)
No comments