Linux+ 101
What is the difference between the -remove and the -purge action with the dpkg command? A. -remove removes the program, -purge also removes the config files B. -remove only removes the program, -purge only removes the config files C. -remove removes a package, -purge also removes all packages dependent on it D. -remove removes only the package file itself. -purge removes all files related to the package
-remove removes the program, -purge also removes the config files
Select the line that best represents what permissions the /etc/passwd file should have A. -rw------- 1 root root 531 Jun 5 22:45 /etc/passwd B. -rw-r--r-- 1 root root 531 Jun 5 22:45 /etc/passwd C. -rw-r--r-- 1 1 1 531 Jun 5 22:45 /etc/passwd D. all answers listed are not correct E. all answers listed are correct
-rw-r--r-- 1 root root 531 Jun 5 22:45 /etc/passwd
Which command (without options) would you use to display how much space is available on all mounted partitions?
/bin/df
Which program finds only files that are in your Path?
/usr/bin/which
Using vi, you want to save changes to the file myfile with :w!, but vi complains it cannot write to the file. Therefore, you want to check the write permissions on the file. To do this without leaving vi, you type: A. :!ls -l myfile B. :\ls -l myfile C. esc :ls -l myfile D. :?ls -l myfile
:!ls -l myfile
What is the output when the following shell script executes? cat << foobar Hello foobar foobar A. The contents of the file foobar B. Hello C. No output but a file named foobar is created D. Hello foobar E. Hello foobar foobar
Hello foobar
You ran out of space and added an eighth disk to your SCSI-1 system. When you try to start, the system no longer boots. What is most likely the cause of this problem? A. SCSI-1 supports only 8 devices including the adaptor B. SCSI-1 supports only 6 disks per adaptor C. There is a SCSI-ID conflict that causes that problem D. You forgot to set the SCSI-ID #8 for the new disk
SCSI-1 supports only 8 devices including the adaptor
You have run out of disk space on a partition. Which of the following would be an easy way to move data to a new partition without reconfiguring the path to the data in existing applications? A. Run ext2fs ACL B. Use a hard link C. Use a symbolic link D. Use the loopback device E. Create a block device offset
Use a symbolic link
You are running Linux 2.0.36 and you need to add a USB mouse to your system. Which of the following statements is true? A. You need to rebuild the kernel B. You need to upgrade the kernel C. You need to load the USB modules for your existing modular kernel D. USB support is not available in Linux
You need to upgrade the kernel
Which shell built-in command can be used to create a shortcut or pseudonym for a longer command? Assume a modern bourne-like shell, such as bash A. shortcut B. ln C. sudo D. link E. alias
alias
Given the following output: prompt> myapp [1]+ Stopped myapp prompt> Which of the following commands will resume executing the stopped process while allowing the user to continue to type commands at the command prompt? A. bg myapp B. continue myapp C. exec myapp D. fg myapp E. myapp &
bg myapp
Which of the following commands will find the string foo in the file file1.txt, regardless of foo being in upper or lower case letters? A. cat file1.txt | grep -i foo B. cat file1.txt > grep -n foo C. grep -i food | file1.txt D. grep -n file1.txt < foo E. grep -n foo file1.txt
cat file1.txt | grep -i foo
Which of the following commands makes /bin/foo executable by everyone but writable only by its owner? A. chmod 557 /bin/foo B. chmod o+rwx,a+rx /bin/foo C. chown 557 /bin/foo D. chmod 755 /bin/foo
chmod 755 /bin/foo
What command will print a list of usernames (first column) and their corresponding user id (uid, third column) from /etc/passwd? A. cut -d: -f 1,3 /etc/passwd B. chop -c 1,3 /etc/passwd C. tac 1-3 /etc/passwd D. fmt -u /etc/passwd
cut -d: -f 1,3 /etc/passwd
Which Debian package system command will list all partially installed packages and suggest how to get them correctly installed? A. dpkg -C B. apt-get -u C. dpkg -Dh D. dpkg -l E. apt-get -y
dpkg -C
Which of these commands allows you to use shared libraries that are in /usr/local/lib? A. export LD_PRELOAD=/usr/local/lib B. export LD_LIBRARY_PATH=/usr/local/lib C. ldconfig/usr/local/lib D. ldd/usr/local/lib
export LD_LIBRARY_PATH=/usr/local/lib
The command used to determine a file's type is A. type B. find C. file D. ls
file
You have read/write permission on an ordinary file foo. You have just run ln foo bar. What would happen if you ran rm foo? A. foo and bar would both be removed B. foo would be removed while bar would remain accessible C. foo would be removed, bar would still exist but would be unusable D. Both foo and bar would remain accessible E. You would be asked whether bar should be removed
foo would be removed while bar would remain accessible
You wish to kill a process with a PID of 123. Select the command which will allow the process to "clean up" before exiting. A. kill -1 123 B. kill -9 123 C. kill -15 123 D. kill -17 123
kill -15 123
What command with all options and/or parameter will send the signal USR1 to any executing process of program apache2?
killall -s USR1 apache2
Which system administration command you can use to update ld.so.cache after the installation of new shared libraries? A. ldconfig B. ldd C. libpath D. newlibs
ldconfig
What command is used to display a file in octal format?
od
You are using quota on your system. How can you see disk quota details? A. repquota B. quota -l C. quota D. quotacheck E. quota -list
repquota
After a minor security incident you are instructed by your lead sys-admin to verify the RPMs installed on a running system. Which command will create a complete report that you can analyze for changes that may be security-related? A. rpm -Va > report B. rpm -Qavy > report C. rpm -Vqt -nomd5 > report D. rpm -checkfiles > report E. rpm -VA -nofiles > report
rpm -Va > report
Many people like the vi text editor but the default bash command line editor recognizes emacs keystrokes. What command entered into a bash initialization file will have bash recognize vi keystrokes after login? A. history -p vi B. alias emacs=vi C. HISTCMD=vi D. set -o vi E. unset emacs
set -o vi
What does the Filesystem Hierarchy Standard enable? (Select 2) A. software to predict the location of the installed files and directories B. software to predict the ownership and access rights to files and directories C. users to predict the location of the installed files and directories D. users to predict how the filesystem should be formatted according to need
software to predict the location of the installed files and directories users to predict the location of the installed files and directories
In bash, inserting 1>&2 after a command redirects A. standard error to standard input B. standard input to standard error C. standard output to standard error D. standard error to standard output E. standard output to standard input
standard output to standard error
The command echo $! will produce what output? A. the process id of the last background command B. the exit status of the last command C. the exit status of the last background command D. the process id of the current shell E. the name of the command being executed
the process id of the last background command
Which of the following commands will change all CR -LF pairs in an imported text file, userlist.txt, to Linux standard LF characters and store it as newlist.txt? A. tr "\r" "\n" < userlist.txt> newlist.txt B. tr -c '\n\r'" < newlist.txt > userlist.txt C. tr -d '\r' < userlist.txt > newlist.txt D. tr '\r' '\n' userlist.txt newlist.txt E. tr -s '^M' '^J' userlist.txt newlist.txt
tr -d '\r' < userlist.txt > newlist.txt
To allow a regular user account to mount and unmount a filesystem (for instance, a cdrom or floppy), which option needs to be added to the corresponding line /etc/fstab? A. nouidchk B. alluser C. user D. auto
user
You are looking for an executable file foo. Select the command that would search for foo within directories set in the shell variable, PATH A. locate B. which C. find D. query E. whereis
which