Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 2 out of 6 pages
Exam (elaborations)

NOS 120 Study Guide Ch 7 UPDATED ACTUAL QUESTIONS AND CORRECT ANSWERS

Document preview thumbnail
Preview 2 out of 6 pages

NOS 120 Study Guide Ch 7 UPDATED ACTUAL QUESTIONS AND CORRECT ANSWERS

Content preview

NOS 120 Study Guide Ch 7 UPDATED ACTUAL QUESTIONS AND CORRECT
ANSWERS

When writing shell scripts and using an if statement to fi
determine whether a set of code should be executed,
what is the proper syntax to end the if construct? Answer:
________________________________


The subdirectory newdir does not currently exist in the mkdir newdir && cd newdir
current directory that you are in. Which of the following mkdir newdir; cd newdir
commands will create a new directory named newdir and
then change into that directory? (Choose two.)
Select one or more:
a. mkdir newdir; cd newdir
b. mkdir newdir || cd newdir
c. mkdir newdir >> cd newdir
d. mkdir newdir && cd newdir


How many times will the following loop execute as part until ctrl-c is used to terminate it
of a script:


#!/bin/bash
COUNTER=0
while [ $COUNTER -lt 7 ]
do
echo "hello world"
done
Select one:
a. 7
b. 0
c. 1
d. until ctrl-c is used to terminate it

, Which of the following will the split command do on a file It will split a file into new equally sized files that are 1/10th of the original file size.
when no other options are specified?
Select one:
a. It will split a file into new files that are 1 kilobyte each.
b. It will split a file into new equally sized files that are
1/10th of the original file size.
c. It will split a file into new files that are 1 megabyte each.
d. It will split a file into new files that are 1,000 lines each.


Match the file with the order in which the BASH shell Second
environment files are read: /etc/profile.d/*
/etc/profile, /etc/bashrc, ~/.bashrc, /etc/profile.d/* Fourth
~/.bashrc
Third
/etc/bashrc
First
/etc/profile


Which of the following is a valid method of running a ./myscript.sh
script named myscript.sh? (Choose two) source myscript.sh
Select one or more:
a. source myscript.sh
b. run myscript.sh
c. ./myscript.sh
d. exec ./myscript.sh


Which of the following would be the results of running 1 through 7 being displayed one number per line.
the command seq 7?
Select one:
a. 6 through 0 being displayed one number per line.
b. 7 through 1 being displayed one number per line.
c. 0 through 6 being displayed one number per line.
d. 1 through 7 being displayed one number per line.


Which of the following will look at the /etc/passwd file for grep root /etc/passwd | tee ~/root.txt
any lines containing the word root and display them out
to the screen while simultaneously writing the results to a
file?
Select one:
a. cat /etc/passwd | grep root >> ~/root.txt
b. grep root /etc/passwd | split ~/root.txt
c. cat /etc/passwd | grep root | merge ~/root.txt
d. grep root /etc/passwd | tee ~/root.txt


Which command can be used to create a new command alias showauth='tail -f /var/log/auth.log'
that will monitor the contents of auth.log as they get
added to the file?
Select one:
a. create showauth='tail -f /var/log/auth.log'
b. ln showauth='tail -f /var/log/auth.log'
c. new showauth as 'cat -f /var/log/auth.log'
d. alias showauth='tail -f /var/log/auth.log'

Document information

Uploaded on
May 28, 2026
Number of pages
6
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$14.29

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Briwisescore
3.0
(1)
Sold
28
Followers
5
Items
15635
Last sold
3 days ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions