Check If File is Downloadable

Save this script into a file, for example,, and make it executable with chmod +x Then run it using ./ Make sure to replace file.txt with the name of your actual text file containing the download links.

This script will iterate over each line in the text file, attempt to download the file using curl’s head request (which only checks if the file is downloadable without actually downloading it), and then print whether the file is downloadable or not.


# Replace 'file.txt' with the name of your text file
while IFS= read -r url; do
    if curl --output /dev/null --silent --head --fail "$url"; then
        echo "$url is downloadable"
        echo "$url is not downloadable"
done < file.txt