Chapter 8 -Linux

You have installed a new Linux system and you want to make a baseline of system performance. Which of these files contain baseline information?
/meminfo
/cpuinfo
You need to get detailed information about system memory. Which command will display all information?
cat/proc/meminfo
Which of the following commands will display information about the PCI devices installed on the system?
lspci
Which command displays information on all USB devices connected to the computer ?
lsusb
Which command displays information about the RAID devices on the computer?
hwinfo –listmd
Which directory contains information about the system state and processes?
/proc
1. Displays the boot options that were given one kernel at boot time.
2. Displays information about the computer’s CPU
3. Displays information about the current kernel vision
4.Displays all the direct memory access assignments for the computer
1. cmdline
2.cpuinfo
3.version
4.dma
Which directory contains information about each kernel module installed on a computer?
/sys/module
Which of the following commands will display which boot options were given to the kernel at boot time?
cat /proc/cmdline
What command displays information about all loaded modules on the system?
lsmod
You just got a new input device named GamePad that you want to use on your computer. You don’t think that the GamePad driver (i.e. kernel module) was compiled into the kernel of your Linux distribution. Which of the following commands will install the driver (gamepad.ko) into the kernel?
insmod gamepad.ko
modprobe gamepad
Which utility runs at startup to load modules into the kernel ?
modprobe
Which of the following represent a hotplug device?
USB
Which daemon allows processes to communicate with each other and relay information about hotplug devices ?
D-Bus
Which directory allows you to name devices when they are connected to the system?
/etc/udev/rules.d/
1. Allows processes to communicate with each other and notify them of new hotplug devices
2. Provides all applications with data about current hardware
3. Dynamically creates device files in a virtual file system as devices are added and removed
4. Exports information about hotplug devices so that other utilities can access the information
1. D-Bus
2. hald
3. /udev
4. sysfs
Which statement is correct on how to differentiate core processes from other services?
They have the lowest pid numbers always below 100
If you run ps-aux the core processes are always at the top of the listing
Which command displays the PPID ?
ps -f
A user calls with a concern about the display he is seeing after running the command : ps -ef. There are a number of processes that display getty and he is afraid that an unauthorized user is attached to the system. How should you respond?
Assure the user that this is normal
Which command displays in the most detail all the processes that are running?
ps -ef
You want to view all currently-running processes that include getty in the process name. Which command would you use?
ps -A | grep getty
You answer a call from a number of users who cannot access the mail server. Which utility would you use quickly so see if the sendmail service is running?
ps
Which command would you use to look for a potential resource hog on a workstation?
top
You need to see a listing of running processes and system status such as memory and CPU usage. Which command will produce the listing?
top
Which signal is the default sent to process by the kill utility?
-15
A developer calls with a problem. They are trying to debug a new daemon and mistakenly placed it on the production machine instead of on a lab machine. It has now entered runaway mode. The PID number is 2345 and attempts have been made to remove it with the standard kill command but it will not stop. Which command would you use to be assured the process will terminate?
kill -9 2345
A service specialist from your company calls you from a customer’s site. They are attempting to install an upgrade to the software but it will not install, reporting that it cannot do so until all non-core services are stopped. You cannot remotely access the machine but the representative tells you that there are only four processes running and their PID numbers are 1,10,100 and 1000. With no further information available which command would you recommend the representative to run?
kill 1000
After a severe lightening strike nearby a number of processes seem to be running on the server in runaway mode. Which utility terminates these processes by name and not just by process id number?
killall
Which signal is the default sent to process the kill utility?
-15
Type the command which will start gedit program in the background
gedit &
You have several processes running in the background as shown from the jobs command below:
[1] + Running gedit &
[2] + Stopped crontab e

What command will bring the gedit program to the foreground?

fg 1
You have a gedit process with a job ID of 6. What command will send the process to the background ?
bg 6
You need to send a process to the foreground . Which command should you enter to identify the job ID for the process?
jobs
Which kill option stops and restarts the process with the same process ID?
-SIGHUP
What is the result of the nohup gedit & command?
gedit will start in the background and persist in the background after logging out of the shell
You have been called to a remote site to troubleshoot a problem with a process that needs to be terminated. You are taken to the workstation having the problem and immediately realize that it is an implementation of Linux you have never worked with before. Which option would you use with the kill utility to see the valid signals available?
kill -l
You need to manage a process in the foreground by pressing the Ctrl+c on the keyboard. What signal code is sent to the process?
SIGINT
A developer calls with a problem. They were trying to debug a new daemon and mistakenly placed it on the production machine instead of a lab machine. To ensure the CPU gives preference to other processes you need to lower the daemon’s priority. The PID number is 2345. Which command would you use to decrease the daemon’s priority?
renice -n 10 2345
What command would you use to assign a new priority to a process that has already started?
renice
You need to determine the priority of several processes. Which command should you enter to identify the process ID and nice value for each process?
top
What command will start the gedit process with the highest priority possible?
nice -n 20 gedit
What is the default nice value for a process not executed with the nice command?
Zero
Which of the following commands starts the gedit program with a priority 1 above the default nice priority?
nice -n -1 gedit
What is the prority of the gedit process after using the nice -n -5 gedit command?
75
Which command could you use to verify if a crontab file exists for user thobbs?
chrontab -l -u thobbs
You are editing the crontab file and want an entry to run every hour at five minutes past the hour. Which of the following entries will accomplish this?
5 * * * * /home/emmett/example.sh
You want the cron process to run a particular application only on Friday and Saturday of each week. Which entry should you place in the fifth field of the chrontab entry?
5,6
Which directory will hold the crontab file for the gshant user account?
/var/spool/cron/gshant
Which file should you edit to schedule a task to execute every week on Saturday?
/etc/cron.daily
You want to keep the gshant user from editing his respective crontab file in /var/spool/cron but still allow all other users on the system to edit their respective crontab file. Which file should you edit?
/etc/cron.deny
Which file should you edit if you want to permit specific users to edit their respective crontab file but deny all other users on the system from editing their crontab file?
/etc/cron.allow
Which crontab options should you use to display the contents of the crontab file for the current user?
crontab -l
Which crontab option should you use to edit the contents of the crontab file for the current user?
crontab -e
After logging in as root you need to manage the crontab file for your Linux system. Which command should you use to edit the crontab file for the gshant user account?
crontab -ue gshant
Which of the following commands removes a job from the at queue ?
at -d
atrm
Which command should you use to list the tasks in the at queue for the current user?
at -l
Which daemon must be running if you want to use the at command?
atd
You want to keep the gshant user from using the at command but still allow all other users to use it. Which file should you edit?
/etc/at.deny
Which of the following statements best describes the effects of having only the gshant user account listed in the /ect/at.allow file?
only gshant and root can use the at command
What command should you remove tasks 2 and 3 in the at queue
atrm 2,3
What does the lprm command do?
Removes jobs from the line printer print queue
What information about print jobs does the utility lpq display?
A numerical job ID that can be used to manipulate the job from other utilities
The username of the person who submitted the job
You want to send the yearend.txt file to the acctg printer. Which command would you use?
lpr -P acctg yearend.txt
User badams sends two print jobs to the Marketing printer (the default printer). He notices the printer is stalled on the first document and uses the lprm – command. What will be the result ?
both of his jobs will be deleted
You want to configure your CUPS from a web browser. Which command is correct?
http:/ /localhost:631
You have installed and configured a new printer manually. You cannot print to the new printer. What should you do?
Use the command /etc/rc.d/init.d/cups restart to restart the cups print service
Use the command /etc/rc.d/init.d/lpd restart to restart the lpd print service
Use the command service cups restart to restart the cups print service
You want to configure your CUPS from a Web browser . What URL address and port should you enter within the Web browser’s address field?
http: //127.0.0.1:631
You are using cupsctl command to configure the /etc/cups/cupsd.conf file. Which cupsctl option will enable the sharing of the locally-connected printer to other computers on the network?
–share-printers
You are configuring the /etc/cups/cupsd.conf file. Which command should you use to prevent remote printers from being displayed in the local system?
cupsctl –no-remote-printers
Which command would you use to create the CUPS root user and password ?
lppasswd
Which of the following lines in the /etc/cups/cupsd.conf file will configure CUPS to listen for print jobs sent only from the local system?
Listen localhost:631
Which command should you use to print 23 copies of the comparables file on the homeprint printer?
lpr -P homeprint -#23 comparables
Which of the following commands will remove all files from the print queue ?
lpc clean
Which lpr option should you use to change the page and width of a print job?
-w
Which command will show the contents of all the print queues on your Linux system?
lpq -a
Which of the following commands removes print job 11 from the hp7 printer?
cancel -P hp7 11
Your Linux system uses the Line Printer Daemon (LPD) to manage print jobs. Which file should you use to edit the LPD configuration?
/etc/lpd.perms
For what purpose would you edit the /etc/localtime/file?
set the current time zone
Which directory on the Linux system contains multiple files and directories used for selecting the time zone ?
/usr/share/zoneinfo
Which command should you use to change the time zone (TZ) environment variable?
tzselect
tzconfig
How can you permanently change the time zone (TZ) environment variable for your shell environment?
Add the TZ variable to the ~/bash_profile file
Which file on a Debian Linux distribution displays the time zone settings?
/etc/timezone
You need to set the system date and time using the date command. Which date option should you use?
-s
A Linux system can determine the time and date in which of the following ways?
It can use NTP to set time
It can set the system clock to local time
You have a large TCP/IP network and want to keep hosts’ real time clocks synchronized. What protocol should you use?
NTP
Which hwclock option sets the system time to the current hardware clock time?
-s
You need to set the hardware clock to the same value as the system clock. Which command should you use?
hwclock -w
Which of the following commands should you use to implement changes in the /etc/ntp.conf file?
service nptd start
You are managing system time on your Linux computer and you need to change settings to point to a local NTP server IP address. Which file should you edit?
/etc/ntp.conf
Which of the following commands manage NTP daemon from the command line?
ntpd
Your system time is over thirty minutes different than the time on the NTP time provider. When you use the ntpd command the time is not updated. Which ntpd option should you include?
-g
Which of the following represent a cluster of NTP time providers?
pool.ntp.org
Which file should you use to configure the hardware clock UTC automatically?
/etc/sysconfig/clock
You want to set the system with the date command to UTC time. Which option should you use?
-u
You want to configure the NTP daemon to receive time from pool.ntp.org. What entry should you place in the /etc/ntp.conf file?
server pool.ntp.org
Which of the following commands will set the system time to match the time server on the network at 192.168.1.10?
netdate 192.168.1.10
Which of the following NTP configuration utilities is deprecated and should be avoided when possible?
ntpdate
You need to install an e-mail server: Which of the following applications are valid Linux e-mail applications?
Postfix
Sendmail
Which command will display the contents of a sendmail mail queue?
sendmail -bp
mailq
You have several messages in the sendmail queue. Which command should you use to deliver messages?
sendmail -q
Which of the following MTA’s use the QMQP and QMTP protocols?
qmail
Which of the following MTA’s are modular?
postfix
qmail
By default which protocol is used by an MTA to send messages to the other MTA ?
SMTP
Which of the following are common protocols used by MTAs to send messages to MUAs?
POP3
IMAP
Recently you updated the /etc/aliases file with several email aliases. Which command should you use to update /etc/aliases.db file?
newaliases
Which of the following file stores the aliasing information for sendmail?
/etc/aliases.db
You are logged in as gshant and you want to forward your mail to the dwant user on the local network. Which file should you edit to redirect the mail for a gshant user?
~/.forward
Which file contains mail for the gshant user account?
/var/spool/mail/gshant
Which command should you use to start the sendmail daemon?
sendmail -bd
Which of the following directories contains email for each user account on the system?
/var/spool/mail
Which database object in an SQL table represents attributes?
columns
Enter the SQL command that will list all tables in the grades databases
SHOW TABLES grades;
Which of the following SQL commands will group information in a list?
GROUP BY
Which SQL database object represents a singly entity or item?
record
Which clause should you add to the SELECT command to filter results from an SQL database?
WHERE
You need to show the contents of the location and price fields in the shirt table in an SQL database. Which SQL command should you use?
SELECT location, price FROM shirt;
Which clause should you add to the SELECT command to sort results from an SQL database
ORDER BY
You use the following command to retrieve specific entry information from the shirt table:
SELECT location, price FROM shirt
However, the command is not returning any information. What should you do?
Add a semicolon to the end of the statement
Which of the following statements best describes the purpose of the following SQL command?
Records for men’s pink polo shirts will be removed from the shirts table.