Page 1 of 1

This assignment consists of three main parts. The first part is practising Linux commands that are related to searching

Posted: Sat Nov 27, 2021 2:24 pm
by answerhappygod
This assignment consists of three main parts. The first part is
practising Linux commands that are related to searching for
files/directories and to searching within text files. The goal of
the second part is to allow you to practice writing basic shell
scripts. The third part is targeted to handle the installation and
removal of software on your Linux using the command line. Answer
each of the following questions and show a screenshot of the output
for each question separately.
Part 1 [CLO 2]: Finding files and searching witing text
files
1) As a regular user, search the /etc directory for every file
named passwd. Redirect error messages from your search to
/dev/null.
2) Create a /tmp/FILES directory. Find all files under the
/usr/share directory that are more than 5MB and less than 10MB and
copy them to the /tmp/FILES directory. Use the option that enables
you to choose, one at a time, whether each file found is acted upon
by the command you enter.
3) Copy the /etc/services file to the /tmp directory. Open the
/tmp/services file in vim, and search for the term WorldWideWeb.
Change that to read World Wide Web (or vice-versa).
4) Create two text files that have multiple lines (some of them
starts with I character and some with S). Search (i.e.,
case-sensitive) for lines that starts with either the character I
or S. Write the command and show the screenshot.
Part 2 [CLO 2]: Writing shell scripts
1) Create a script in your $HOME/bin directory called
myownscript. When the script runs, it should output information
that appears as follows:
This Assignment Consists Of Three Main Parts The First Part Is Practising Linux Commands That Are Related To Searching 1
This Assignment Consists Of Three Main Parts The First Part Is Practising Linux Commands That Are Related To Searching 1 (32.89 KiB) Viewed 103 times
Of course, you need to read in your current date/time, current
working directory, and hostname. Also, include comments about what
the script does and indicate that the script should run with the
/bin/bash shell.
2) Create a script that prompts users for the name of the street
and town where they grew up. Assign town and street to variables
called mytown and mystreet, and output them with a sentence that
reads as shown below (of course, $mystreet and $mytown will appear
with the actual town and street the user enters):
This Assignment Consists Of Three Main Parts The First Part Is Practising Linux Commands That Are Related To Searching 2
This Assignment Consists Of Three Main Parts The First Part Is Practising Linux Commands That Are Related To Searching 2 (26.45 KiB) Viewed 103 times
3) Create a script called myos that asks the user, “What is your
favorite operating system?” Output an insulting sentence if the
user types “Windows” or “Mac.” Respond “Great choice!” if the user
types “Linux.” For anything else, say “Is an operating system?”
4) Create a script that runs through the words moose, cow,
goose, and sow through a for loop. Have each of those words
appended to the end of the line “I have a. . . .”
5) Write a script that counts the number of files ending in .sh
in the current directory and present the number of lines in each
file (work in the directory that has the shell files of the
previous questions so you can get an output of this script). Wrap
an if statement around the script so it is also correct when there
are zero files ending in .sh.
6) Write a shell script that add the execute permission to a
file if it exists and repeat that process as long as the user still
need to perform that task. The script generates an output similar
to the following:
This Assignment Consists Of Three Main Parts The First Part Is Practising Linux Commands That Are Related To Searching 3
This Assignment Consists Of Three Main Parts The First Part Is Practising Linux Commands That Are Related To Searching 3 (627.9 KiB) Viewed 103 times
Part 3 [CLO 4]: Getting and manging software
1) Login as root user
2) Update your Ubuntu apt-get tool.
3) Upgrades all installed packages.
4) What is LAMP stack?
5) Install each layer software of LAMP on your Linux. Follow
each installation with
a verification step to make sure everything installed
correctly.
Install Apache, test Apache
Install PHP
Test PHP, First give the permission to directory
(/var/www/html), then test PHP programs using examples.
Install MySQL
Install phpMyAdmin
Configure Apache for phpMyAdmin
Open your favourite web browser and access phpMyAdmin
Today is Sat Jan 4 15:45:04 EST 2020. You are in /home/joe and your host is abc.example.com.

The street I grew up on was $mystreet and the town was $mytown

Huda @HDUAS-iMac Documents % bash myscript.sh Do you need to add the execute premission to a file? Answer yes/no yes What is the filename? script.sh The permission is added Do you still need to add the execute premission to another file? yes What is the filename? myscript.sh The permission is added Do you still need to add the execute premission to another file? yes What is the filename? example.sh The file does not exist Do you still need to add the execute premission to another file? no Thanks for using my script Huda @ HDUAS-iMac Documents %