Question

In: Computer Science

Write a bash script to download two files, say file1.gz and file2.gz from a given web...

Write a bash script to download two files, say file1.gz and file2.gz from a given web address to the directory "assignment5"

Solutions

Expert Solution

Here is the code for the given script.

wget https://ftp.gnu.org/gnu/wget/file1.gz -P assignment5

wget https://ftp.gnu.org/gnu/wget/file1.gz -P assignment5

We will use the wget to download two files, say file1.gz and file2.gz from a given web address to the directory "assignment5".

Since this file actually does not exist in the link, I have also given an example of the actuall file which gets downlaoded to the assignment5 folder for demonstration purpose.

wget -P or --directory-prefix option is used to set the directory prefix where all retrieved files and subdirectories will be saved to.

Syntax is

wget linkaddressandfilenameattheend -P destinaionfolder

Wget is a popular, non-interactive and widely used network downloader which supports protocols such as HTTP, HTTPS, and FTP.

Output (as file does not exist its gives error.

Example for Actuall working of code when the link is working just to show the code works:

wget https://ftp.gnu.org/gnu/wget/wget-1.5.3.tar.gz -P assignment5

wget https://ftp.gnu.org/gnu/wget/file1.gz -P assignment5

File get downloaded on assignment5 folder.

If you have any doubts, leave a comment below before rating. I'll be happy to assist you further.

Do UPVOTE this as I have put a lot of EFFORT in answering this question. It really helps me.


Related Solutions

There are two text files, whose names are given by two String variables, file1 and file2....
There are two text files, whose names are given by two String variables, file1 and file2. These text files have the same number of lines. Write a sequence of statements that creates a new file whose name consists concatenating the names of the two text files (with a "-" in the middle) and whose contents of merging the lines of the two files. Thus, in the new file, the first line is the first line from the first file, the...
Create two files, file1.csv and file2.csv Write the following information in file1.csv: Apple 1.69 001 Banana...
Create two files, file1.csv and file2.csv Write the following information in file1.csv: Apple 1.69 001 Banana 1.39 002 Write the following information in file2.csv: Apple 1.69 001 Carrot 1.09 003 Beef 6.99 004 You have two files, both of the two files have some information about products: • Read these two files, find out which products exist in both files, and then save these products in a new file. You can use the two files you created in Lab 1...
write a bash shell script using the for-loop construct that counts the number of files and...
write a bash shell script using the for-loop construct that counts the number of files and directories looping through the files in the directory name provided by the user on a prompt by the script and prints "TOO many files" is the count of files is larger than a random number it generates between 20 and 40
Write a bash script to find all the files ending with .c recursively for every directory...
Write a bash script to find all the files ending with .c recursively for every directory in your current working directory, then copy each one to a folder called programs, need handle duplicates by appending the number to the end of the file (ex main.c main-1.c ) compile them and generate a report report should look like: main.c compiles prog2.c failed main-2.c compiles etc.
Program in Bash: Write a program using bash script that can read a file from the...
Program in Bash: Write a program using bash script that can read a file from the same directory, sort the nonrepeating integers from 0-9 from smallest to largest, and output the results on the same line. Do not use the sort function.
Program in Bash: Write a program using bash script that can read a file from the...
Program in Bash: Write a program using bash script that can read a file from the same directory, sort the nonrepeating integers from 0-9 from smallest to largest, and output the results on the same line. Do not use the sort function.
Write a short bash script that takes in two arguments from a user, asks the user...
Write a short bash script that takes in two arguments from a user, asks the user whether they would like to add, subtract, multiply, or divide. Each of these operations must be a function that returns data.
In this assignment, you are required to write a Bash script, call it assignment2.sh. Your Bash...
In this assignment, you are required to write a Bash script, call it assignment2.sh. Your Bash script has to accept at least four input arguments, and must: 1) Print to the user a set of instructions explaining how the PATH variable can be used in Bash. 2) Save the manual of the 'awk' command in the file /tmp/help.txt. 3) Shut down your Ubuntu box at 2 o'clock tonight. 4) Store your name and your partner's name in a text file...
Fully Functional Script written in BASH In this section, you will write a fully functional script...
Fully Functional Script written in BASH In this section, you will write a fully functional script to help your manager with an important project that will build upon what you learned from your script work in Milestone Four. After you have written the script, you will execute it to generate a report for all three users (once for Bob, once for Henry, and once for Frank). You should have three unique generated reports in your ~/scripts directory (or more if...
⦁   Write a Bash script that prompts for user input and reads a string of text...
⦁   Write a Bash script that prompts for user input and reads a string of text from the user. If the user enters a no null (no empty) string, the script should prompt the user to re-enter again the string; otherwise should display the string entered “. ⦁   Given an array of the following four integers (3, 5, 13, 14); write a Bash script to display the second and all elements in the array.    ⦁   Write a short Bas...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT