Chapter 9 Practice Questions

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 to quickly 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 a memory and CPU usage. Which command will produce the listing?
top
Which is the default signal sent to processes by the kill utility?
-15
A developer calls with a problem. They were trying to debug a new daemon and mistakenly places 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 that the process will terminate?
Kill -9 2345
After a severe lightning 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
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. Which command would you enter at the command prompt to send the process to the background?
bg 6 (written)
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 (PID)?
-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 in to a remote site to troubleshoot a problem with a process that needs to be terminated. You are taken to the workstation with 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 at the command prompt to see the valis signals available with Linux system you’re not familiar with?
kill -l (written)
You need to manage a process in the foreground by pressing 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 on a lab machine. To ensure the CPU gives preference to other processes, you need to lower the daemon’s priority. The PID number us 2345. Which command would you use to decrease the daemon’s priority?
renice -n 10 2345
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 would you enter at the command prompt to start the gedit process with the highest priority possible?
nice -n -20 gedit (written)
What is the default nice value for a process not executed with the nice command?
Which of the following commands starts the gedit program with a priority 1 above the default nice priority?
nice -n -1 gedit
Which command could you use to verify if a crontab file exists for user thobbs?
crontab -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 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. What is the full path and filename of the file you should edit?
/etc/cron.deny (written)
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
After logging in as root, you need to manage the crontab files for your Linux system. Which command should you use to edit the crontab file for the gshant user account?
crontab -ue gshant
Which command should you enter at the command prompt to list the tasks in the at queue for the current user?
at -l (written)
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 other users to use it. What is the full path and filename of the file you should edit?
/etc/at.deny (written)
Which of the following statements best describes the effects of having only the gshant user account listed in the /etc/at.allow file?
Only gshant and root can use the at command
What should be entered at the command prompt to remove tasks 2 and 3 in the at queue?
atrm 2 3 (written)
If a system is down at the time a recurring regularly scheduled task is supposed to run, which task scheduling service will run the task when the system is back up again?
anacron
What is the full path and filename of the file that is used to schedule tasks for the anacron daemon?
/etc/anacrontab/ (written)
What service does cron rely on to run the scripts in the /etc/cron.daily, /etc/cron.weekly, and /etc/cron.monthly directories?
ancron(written)
Anacron creates a timestamp file that tells you the last time a regularly scheduled job was run. What is the full path and name of the directory that contains these timestamps files?
/var/spool/anacron/
What does the lprm command do?
Remove jobs from the line printer print queue
What information about print jobs does the utility lpq display?
-The username of the person who submitted the job
-A numerical job ID that can be used to manipulate the job from other utilities
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 the jobs will be deleted
You want to configure your CUPS from a Web browser. Which command is correct?
http://localhost:631
You have connected a new printer to a systemd-based Linux server. You cannot print to the new printer from a user workstation on the network. What tasks should you do first on the server?
-Use rpm -qi cups or dnf list cups to make sure the CUPS daemon is installed
-Use systemctl status cups to make sure CUPS printing service is running
You want to configure your CUPS from a Web browser. Which URL address and port should you enter within the Web browser’s address field?
http://127.0.0.1:631 (written)
You are using the cupsctl command to configure the /etc/cups/cupsd.conf file. Which cupstl option will enable the sharing of the locally-connected printer to other computers on the network?
–share-printers (written)
You are configuring the /etc/cups/cupsd.conf file. Which command should you use to prevent remote printers from being displayed on the local system?
cupsctl –no-remote-printers
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
What should you enter at the command prompt to print 23 copies of the comparables file on the homeprint printer?
lpr -P homeprint – #23 comparables (written)
Which lpr option should you use to change the page width of the print job?
-w
Which command will show the contents of all the print queues on your Linux system?
lpq -a (written)
Which of the following commands removes print job 11 from the hp7 printer?
cancel -P hp7 11
Which of the following lines in the /etc/cups/cupsd.conf file will configure CUPS to listen for print jobs coming in on the server’s network interface with the IP address 192.168.0.1 through the IPP port?
Listen 192.168.0.1:631
For what purpose would you edit the /etc/localtime file?
Set the current time zone
You need to create a symbolic link to the /usr/share/zoneinfo/EST time zone file that permanently alters the time zone for the system. What do you enter at the command prompt to accomplish this?
ln -s /usr/share/zoneinfo/ES (written)
What is the full path to the directory on a Linux system that contains multiple files and directories used for selecting a time zone?
/usr/share/zoneinfo (written)
Which command should you use to change the timezone (TZ) environment variable?
-tzconfig
-tzselect
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 the local time
You have a large TTCP/IP network and want to keep hosts’ real time clocks synchronized. What protocol should you use?
NTP
You are using a systemd-based Linux system and have made changes in the /etc/ntp.conf file. Which of the following commands should you use to implement these changes?
Systemctl restart ntpd
You are managing system time on your Linux computer, and you need to change the settings to point to a local NTP server IP address. What is the full path and filename of the file you should edit?
/etc/ntp.conf (written)
Which of the following commands manages the 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 (written)
You want to set the system time with the date command to UTC time. Which date options 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
You need to install an e-mail server. Which of the following applications are valid Linux e-mail applications?
-Sendmail
-Postfix
What do you enter at the command prompt to display the contents of an MTA mail queue?
mailq (written)
Which of the following MTAs use the QMQP and QMTP protocols?
qmail
Which of the following MTAs are modular?
-postfix
-qmail
By default, which protocol is used by an MTA to send messages to other MTAs?
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. What command do you use at the command prompt to update /etc/aliases.db file?
newaliases (written)
Which of the following files stores the aliasing information for MTAs?
/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 (written)
What is the path and filename of the file that contains mail for the gshant user account?
/var/spool/mail/gshant (written)
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 database.
SHOW TABLES grades; (written)
Which of the following SQL command will group information in a list?
GROUP BY
Which SQL database object represents a single entity or item?
record
Which clause should you add to the SELECT command to filter results from an SQL database?
WHERE (written)
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 (written)
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? DELETE FROM shirts WHERE color=’pink’ AND type=’polo’ AND gender=’male’;
Records for men’s pink polo shirts will be removed from the shirts table.