1. The echo command:: Is used to output text to the console
2. A file begins with #!/bin/csh. This means:: Running the script will invoke
/bin/csh to interpret the rest of the file
3. Which are appropriate editors for writing shell scripts?: nano vi
4. Most of nanos commands take the form of:: Control and another character
5. Which of the following are correct about for and while loops?: for loops operate over a fixed
list of items
while loops have a test each cycle to determine if it should run again
6. Which shell command accepts input from the users keyboard?: read
7. How would you finish your script with an exit code of 42?: exit 42
8. The if command looks for what exit code to consider a condition to be true?: 0
9. Given the following script:
while [ ! f /tmp/foo ]; do echo n .
process_data > /tmp/foo done
Which of the following are true?: If a file called /tmp/foo exists, process_data wont be run
process_data will be called at most once
10.How would you write a test that says if /tmp/foo is a directory or USERS is greater than 5?: test d
/tmp/foo o $USERS gt 5
11.Given the following part of a script:
if [ -f $1 ]; then
echo I am here fi
What is the meaning of $1?: It is the first argument passed to the script
12.What is the correct way to assign the word "Hello" to a variable?: A=Hello
13.What is the meaning of $(( $i + 1)) ?: 1 will be added to the i variable
14.What is the correct way to save the current directory to a variable?: -
A=`pwd`
15.What information is held inside $? ?: The previous commands exit code
1/
6
, UNCW CIT225 Exam (Modules 9 - 16)
16.A conditional that lets you make multiple comparisons with a pattern is called:: case
17.One way to install new software on a Linux system is to use a package management system.:
True
18.Which of the following are package management commands for distribu- tions with software
distributed in files ending in .deb?: dpkg
aptitude
apt-get
19.The Process ID (PID) of the init process is: 1
20.The process (ps) command shows only processes running in the current shell by default.: True
21.The free command outputs statistics about:: Memory usage
22.All log files contain only text data.: False
23.A load average of 1.0 always means the system is fully loaded.: False
24.The following are valid Linux option styles:: Traditional Unix with a single dash (-)
BSD Unix without a dash
GNU long options with two dashes (--)
25.Which file contains the information passed to the kernel at boot time?: -
/proc/cmdline
26.To make changes permanent for kernel parameter files found under
/proc/sys, the following file can have entries added to it:: /etc/sysctl.conf
27.What does the acronym RPM mean?: RPM Package Management
28.When you execute the dmesg command, the system displays messages that are generated by
the kernel.
True or False?: True
29.What directory typically contains log files?: /var/log
30.To get a list of all packages installed on a system using RPM Package Management you can
execute:: rpm -qa
31.Which of the following are valid CPU types for Intel-based platforms?: 32 bit
64 bit
32.64 bit platforms can access more memory than 32 bit platforms: True
33.A CPU flag...: defines the features that the CPU supports.
34.Which command displays information from SMBIOS?: dmidecode
35.Which of the following are common busing systems?: USB PCI
36.A division of a hard drive may be referred to as a .: partition
slice
2/
6