Start New Discussion within our Linux and Unix Community

I am trying to understand one test script, which includes

if [ ! -f mahout-work/reuters21578.tar.gz ]; then
echo "Downloading Reuters-21578"
curl \
                     -o mahout-work/reuters21578.tar.gz

What does the condition of

! -f mahout-work/reuters21578.tar.gz

mean? And what does

curl \ -o mahout-work/reuters21578.tar.gz

stand for? Thanks.

Basically in the first part of the code the condition in the if statement says "if the file reuters21578 does not exist in the mahout-work directory"
Note: The ! is the logical NOT operator.

If the file does not exist in the specified directory the code under the if statement (the 2nd part you wanted understand) uses the program curl to download the file from a website and saves it in the mahout-work directory.

This question has already been answered. Start a new discussion instead.