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 9 pages
Exam (elaborations)

NOS 120 Study Guide Ch 7 UPDATED ACTUAL Exam Questions and CORRECT Answers

Document preview thumbnail
Preview 2 out of 9 pages

NOS 120 Study Guide Ch 7 UPDATED ACTUAL Exam Questions and CORRECT Answers When writing shell scripts and using an if statement to determine whether a set of code should be executed, what is the proper syntax to end the if construct? Answer: ________________________________ - CORRECT ANSWER - fi The subdirectory newdir does not currently exist in the current directory that you are in. Which of the following commands will create a new directory named newdir and then change into that directory? (Choose two.)

Content preview

NOS 120 Study Guide Ch 7 UPDATED
ACTUAL Exam Questions and CORRECT
Answers
When writing shell scripts and using an if statement to determine whether a set of code should be
executed, what is the proper syntax to end the if construct? Answer:
________________________________ - CORRECT ANSWER - fi


The subdirectory newdir does not currently exist in the current directory that you are in. Which
of the following 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 - CORRECT ANSWER - mkdir newdir && cd newdir
mkdir newdir; cd newdir


How many times will the following loop execute as part 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 - CORRECT ANSWER - until ctrl-c is used to
terminate it


Which of the following will the split command do on a file 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. - CORRECT ANSWER - It
will split a file into new equally sized files that are 1/10th of the original file size.


Match the file with the order in which the BASH shell environment files are read:

/etc/profile, /etc/bashrc, ~/.bashrc, /etc/profile.d/* - CORRECT ANSWER - Second
/etc/profile.d/*
Fourth
~/.bashrc
Third
/etc/bashrc
First
/etc/profile


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

d. exec ./myscript.sh - CORRECT ANSWER - ./myscript.sh

Document information

Uploaded on
March 26, 2025
Number of pages
9
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$11.49

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.
MGRADES
4.0
(235)
Sold
1538
Followers
108
Items
111318
Last sold
12 hours 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