Chapter 8 -Linux

question

You have installed a new Linux system and you want to make a baseline of system performance. Which of these files contain baseline information?
answer

/meminfo /cpuinfo
question

You need to get detailed information about system memory. Which command will display all information?
answer

cat/proc/meminfo
question

Which of the following commands will display information about the PCI devices installed on the system?
answer

lspci
question

Which command displays information on all USB devices connected to the computer ?
answer

lsusb
question

Which command displays information about the RAID devices on the computer?
answer

hwinfo –listmd
question

Which directory contains information about the system state and processes?
answer

/proc
question

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
answer

1. cmdline 2.cpuinfo 3.version 4.dma
question

Which directory contains information about each kernel module installed on a computer?
answer

/sys/module
question

Which of the following commands will display which boot options were given to the kernel at boot time?
answer

cat /proc/cmdline
question

What command displays information about all loaded modules on the system?
answer

lsmod
question

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?
answer

insmod gamepad.ko modprobe gamepad
question

Which utility runs at startup to load modules into the kernel ?
answer

modprobe
question

Which of the following represent a hotplug device?
answer

USB
question

Which daemon allows processes to communicate with each other and relay information about hotplug devices ?
answer

D-Bus
question

Which directory allows you to name devices when they are connected to the system?
answer

/etc/udev/rules.d/
question

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
answer

1. D-Bus 2. hald 3. /udev 4. sysfs
question

Which statement is correct on how to differentiate core processes from other services?
answer

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
question

Which command displays the PPID ?
answer

ps -f
question

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?
answer

Assure the user that this is normal
question

Which command displays in the most detail all the processes that are running?
answer

ps -ef
question

You want to view all currently-running processes that include getty in the process name. Which command would you use?
answer

ps -A | grep getty
question

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?
answer

ps
question

Which command would you use to look for a potential resource hog on a workstation?
answer

top
question

You need to see a listing of running processes and system status such as memory and CPU usage. Which command will produce the listing?
answer

top
question

Which signal is the default sent to process by the kill utility?
answer

-15
question

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?
answer

kill -9 2345
question

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?
answer

kill 1000
question

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?
answer

killall
question

Which signal is the default sent to process the kill utility?
answer

-15
question

Type the command which will start gedit program in the background
answer

gedit &
question

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?
answer

fg 1
question

You have a gedit process with a job ID of 6. What command will send the process to the background ?
answer

bg 6
question

You need to send a process to the foreground . Which command should you enter to identify the job ID for the process?
answer

jobs
question

Which kill option stops and restarts the process with the same process ID?
answer

-SIGHUP
question

What is the result of the nohup gedit & command?
answer

gedit will start in the background and persist in the background after logging out of the shell
question

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?
answer

kill -l
question

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?
answer

SIGINT
question

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?
answer

renice -n 10 2345
question

What command would you use to assign a new priority to a process that has already started?
answer

renice
question

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?
answer

top
question

What command will start the gedit process with the highest priority possible?
answer

nice -n 20 gedit
question

What is the default nice value for a process not executed with the nice command?
answer

Zero
question

Which of the following commands starts the gedit program with a priority 1 above the default nice priority?
answer

nice -n -1 gedit
question

What is the prority of the gedit process after using the nice -n -5 gedit command?
answer

75
question

Which command could you use to verify if a crontab file exists for user thobbs?
answer

chrontab -l -u thobbs
question

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?
answer

5 * * * * /home/emmett/example.sh
question

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?
answer

5,6
question

Which directory will hold the crontab file for the gshant user account?
answer

/var/spool/cron/gshant
question

Which file should you edit to schedule a task to execute every week on Saturday?
answer

/etc/cron.daily
question

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?
answer

/etc/cron.deny
question

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?
answer

/etc/cron.allow
question

Which crontab options should you use to display the contents of the crontab file for the current user?
answer

crontab -l
question

Which crontab option should you use to edit the contents of the crontab file for the current user?
answer

crontab -e
question

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?
answer

crontab -ue gshant
question

Which of the following commands removes a job from the at queue ?
answer

at -d atrm
question

Which command should you use to list the tasks in the at queue for the current user?
answer

at -l
question

Which daemon must be running if you want to use the at command?
answer

atd
question

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?
answer

/etc/at.deny
question

Which of the following statements best describes the effects of having only the gshant user account listed in the /ect/at.allow file?
answer

only gshant and root can use the at command
question

What command should you remove tasks 2 and 3 in the at queue
answer

atrm 2,3
question

What does the lprm command do?
answer

Removes jobs from the line printer print queue
question

What information about print jobs does the utility lpq display?
answer

A numerical job ID that can be used to manipulate the job from other utilities The username of the person who submitted the job
question

You want to send the yearend.txt file to the acctg printer. Which command would you use?
answer

lpr -P acctg yearend.txt
question

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 ?
answer

both of his jobs will be deleted
question

You want to configure your CUPS from a web browser. Which command is correct?
answer

http:/ /localhost:631
question

You have installed and configured a new printer manually. You cannot print to the new printer. What should you do?
answer

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
question

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?
answer

http: //127.0.0.1:631
question

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?
answer

–share-printers
question

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?
answer

cupsctl –no-remote-printers
question

Which command would you use to create the CUPS root user and password ?
answer

lppasswd
question

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?
answer

Listen localhost:631
question

Which command should you use to print 23 copies of the comparables file on the homeprint printer?
answer

lpr -P homeprint -#23 comparables
question

Which of the following commands will remove all files from the print queue ?
answer

lpc clean
question

Which lpr option should you use to change the page and width of a print job?
answer

-w
question

Which command will show the contents of all the print queues on your Linux system?
answer

lpq -a
question

Which of the following commands removes print job 11 from the hp7 printer?
answer

cancel -P hp7 11
question

Your Linux system uses the Line Printer Daemon (LPD) to manage print jobs. Which file should you use to edit the LPD configuration?
answer

/etc/lpd.perms
question

For what purpose would you edit the /etc/localtime/file?
answer

set the current time zone
question

Which directory on the Linux system contains multiple files and directories used for selecting the time zone ?
answer

/usr/share/zoneinfo
question

Which command should you use to change the time zone (TZ) environment variable?
answer

tzselect tzconfig
question

How can you permanently change the time zone (TZ) environment variable for your shell environment?
answer

Add the TZ variable to the ~/bash_profile file
question

Which file on a Debian Linux distribution displays the time zone settings?
answer

/etc/timezone
question

You need to set the system date and time using the date command. Which date option should you use?
answer

-s
question

A Linux system can determine the time and date in which of the following ways?
answer

It can use NTP to set time It can set the system clock to local time
question

You have a large TCP/IP network and want to keep hosts’ real time clocks synchronized. What protocol should you use?
answer

NTP
question

Which hwclock option sets the system time to the current hardware clock time?
answer

-s
question

You need to set the hardware clock to the same value as the system clock. Which command should you use?
answer

hwclock -w
question

Which of the following commands should you use to implement changes in the /etc/ntp.conf file?
answer

service nptd start
question

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?
answer

/etc/ntp.conf
question

Which of the following commands manage NTP daemon from the command line?
answer

ntpd
question

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?
answer

-g
question

Which of the following represent a cluster of NTP time providers?
answer

pool.ntp.org
question

Which file should you use to configure the hardware clock UTC automatically?
answer

/etc/sysconfig/clock
question

You want to set the system with the date command to UTC time. Which option should you use?
answer

-u
question

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?
answer

server pool.ntp.org
question

Which of the following commands will set the system time to match the time server on the network at 192.168.1.10?
answer

netdate 192.168.1.10
question

Which of the following NTP configuration utilities is deprecated and should be avoided when possible?
answer

ntpdate
question

You need to install an e-mail server: Which of the following applications are valid Linux e-mail applications?
answer

Postfix Sendmail
question

Which command will display the contents of a sendmail mail queue?
answer

sendmail -bp mailq
question

You have several messages in the sendmail queue. Which command should you use to deliver messages?
answer

sendmail -q
question

Which of the following MTA’s use the QMQP and QMTP protocols?
answer

qmail
question

Which of the following MTA’s are modular?
answer

postfix qmail
question

By default which protocol is used by an MTA to send messages to the other MTA ?
answer

SMTP
question

Which of the following are common protocols used by MTAs to send messages to MUAs?
answer

POP3 IMAP
question

Recently you updated the /etc/aliases file with several email aliases. Which command should you use to update /etc/aliases.db file?
answer

newaliases
question

Which of the following file stores the aliasing information for sendmail?
answer

/etc/aliases.db
question

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?
answer

~/.forward
question

Which file contains mail for the gshant user account?
answer

/var/spool/mail/gshant
question

Which command should you use to start the sendmail daemon?
answer

sendmail -bd
question

Which of the following directories contains email for each user account on the system?
answer

/var/spool/mail
question

Which database object in an SQL table represents attributes?
answer

columns
question

Enter the SQL command that will list all tables in the grades databases
answer

SHOW TABLES grades;
question

Which of the following SQL commands will group information in a list?
answer

GROUP BY
question

Which SQL database object represents a singly entity or item?
answer

record
question

Which clause should you add to the SELECT command to filter results from an SQL database?
answer

WHERE
question

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?
answer

SELECT location, price FROM shirt;
question

Which clause should you add to the SELECT command to sort results from an SQL database
answer

ORDER BY
question

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?
answer

Add a semicolon to the end of the statement
question

Which of the following statements best describes the purpose of the following SQL command?
answer

Records for men’s pink polo shirts will be removed from the shirts table.

Get instant access to
all materials

Become a Member