Linux Practice Test

Flashcard maker : Lily Taylor
The MTS log file contains thousands of entries, but you are only interested in the most recent entries. Each time entries are added, they are appended to the end of the file. Which utility will be best suited for examining the entries you are interested in?
tail
You are working on a Linux distribution that uses systemd. Which file in the /lib/systemd/system/ directory is used to start the services necessary for runlevel 5?
graphical.target
Which command will print the line count, word count and byte count respectively in the /home/gshant/servepath file? (Enter the command as if at the command prompt.)
wc -lwc /home/gshant/servepath
A directory intended to be used only by administrators keeps filling with files. Which of the following commands would you used to see only the names of the users saving files in the directory?
ls -l | cut -d ” ” -f5
You need to create the directory /var/oracle/database/9i. Only the directory /var currently exists. From the root of the filesystem, which command will create the directory path?
mkdir -p /var/oracle/database/9i
You are working at the command line and need to start a new Bourne-again shell (bash) session. What should you type? (Enter the command as if at the command prompt.)
bash
You have a system with a single hard disk. You add a new hard drive to your system. Which of the following commands would you use to partition the new drive?
fdisk /dev/sdb
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 need to chang the formatting of the /home/varstown file as it prints. Specifically, you need to add double-spacing to each line in the file. What command should you use? (Enter the command as if at the command prompt.)
pr -d /home/varstown
Which of the following methods should you use to configure dynamic libraries on a Linux system?
Use the LD_LIBRARY_PATH environment variable to specify additional directories to search for library files.
Modify /etc/ld.so.conf to add the path of libraries.
You are looking for a more orderly way of stopping processes besides running the kill utility. Another administrator tells you that scripts exist to stop most processes in an orderly fashion. Where should you look for such scripts on your system?
/etc/init.d
What is the path for the menu.lst file? (include the complete path)
/boot/grub
What command should you enter to see a list of all the commands you recently used at the command prompt?
history
Which of the following utilities will substitute an existing string with a new string within a file?
sed
You are attempting to install an RPM package on your Linux System, but the system tells you that package has dependencies that are not installed. What rpm option will override the need to install the dependencies? (Enter the command as if at the command prompt.)
rpm –nodeps
You have added several new hard disks to your system. After partitioning and formatting you have modified a configuration file to mount these new filesystems automatically. You want to document the change you made. What file would you document?
/etc/fstab
Under the Filesystem Hierarchy Standard (FHS), which directory contains the device files for a Linux system? (Enter the full path of the directory.)
/dev
What is the result of the uname -a command?
All system information is displayed on the screen.
You have just installed a new program that will be used by all users on the computer. After installation, you log in as a regular user and you try to run the program. The program stops and displays the following error: Error: not running as root. What should you do so that all users can run this program?
set the SUID on the program
Which command reloads the library cache every time libraries are added to removed, and updates the symbolic links?
ldconfig
Which file system is a FAT32 filesystem for Linux?
vfat
You need to create an ext4 file system on the first partition on the second hard disk drive. What command should you use?
mkfs.ext4 /dev/sdb1
After opening a file in vi, you want to switch from command mode to command line mode. What key should you enter?
:
Which of these configuration files define the default runlevel of your system?
/etc/inittab
You are using awk to print a sorted list of the user names in /etc/passwd. Which command will accomplish the sorted output?
awk -F: ‘{print $1} ‘ /etc/passwd | sort
You are logged in as root. You have the file, letter.doc, on a CD in the first compact disk drive. Which command will copy the file from the CD to your home directory.
cp /mnt/scd0/letter.doc /root
Which of the following commands would you use to find all of the files on the system that have either blue or gold in their names?
find / -name ‘*blue*’ -o -name ‘*gold*’
Which command prints the attributes of a /boot/grub/grub.conf file?
lsattr /boot/grub/grub.conf
You need to implement disk quotas on you Linux system. You need the quotas on the / directory. Which file must be edited to implement quotas for users and groups?
/etc/fstab
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 at the top of the listing.
What is the purpose of the rpm -V command?
verify that an RPM packages is free from errors.
You are called into the office of a newly hired manager. He has copied a file from his old place of work onto his new workstation, but is now receiving an error message that access is denied each time he tries to access the file. He is not the owner of the file, and not a member of the group the file is associated with. Which of the following represents the least set of file permissions needed for him to be able to read and write to the file?
666
You use a program on your Linux system named photorec. Which command will display the path to the the photorec binary file?
which photorec
Which command will display all the environment variables on the system?
set
Which of the following options is the standard shell for most Linux computers?
Bourne-again shell (bash)
You have installed a package called mathpac with yum. After a system upgrade, the package is not working correctly. Which command should you try first to get the package to work?
yum update mathpac
The /home/gshant/smp directory contains several files. The directory and files need to be removed. You change directories to /home/gshant. Which command should you use?
rm -r smp
You have made changes to the /etc/inittab file, but they do not seem to be taking effect. This is the busy time of day, and you do not want to bring the system down and back up. Which command forces the system to reread the entries in the /etc/inittab file?
init q
Which of the following is not a characteristic of hard links?
distinct inode
Which of the following commands displays all lines in ~/smarts, omitting the last 10 lines?
head -n -10 ~smarts
A file named acctg needs to have the SGID permission set on it while keeping all other permissions at their present value. Which of the following commands will accomplish this?
chmod g+s acctg
What is the purpose of the messages log file in /var/log/messages and what type of information does it hold?
It is the system message log file, and it holds kernel messages and messages from applications.
What is the full path for Yellowdog Updater Modified (YUM) configuration file?
/etc/yum.conf
You previously created symbolic links in your home directory to a set of files in the /data directory using the ln -s command. The system administrator has just deleted those files. What happens to the links that you created?
The symbolic links would still exist in your home directory but they would now be broken.
You want to perform an audit and make sure that group membership for user dblair is correct. Which command would you use to view the groups that dblair is a member of?
grp -e dblair /etc/group
Setting the SUID flag is a powerful and useful feature. It can have weakness associated with its use. Which of the following statements identifies a weakness?
setting the SUID flag for an application or process owned by the root user is a potential security hole.
Which of the following lines in the /etc/inittab file defines the default runlevel?
id:3:initdefault:
While in command mode, you need to find the term Sam. Which command should you use?
/Sam
Which apt-cache option shows the missing dependencies in the package cache?
unmet
Which command would you use to rename the /home/pmallory/reports file to reports.bak?
mv /home/pmallory/reports /home/pmallory /reports.bak
Which of the following commands will cut an entire line from a file while in vi command line mode?
dd
Which file would you check to see system startup error messages?
/var/log/boot.msg
/var/log/boot.log
You are working with the following RPM package: acroread- 8.1.3-51.6.i56.rpm. Drag the naming convention term on the left to match the items on the right.
i586- Architecture type
8.1.3- Version number
acroread- Package name
51.6- Release number
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.
assure the user that this is normal
You need to restore a file, yearend.xls, from the archive 013004.tar.gz in the backup directory. The file needs to be restored to /home/accounting. Which command will perform the restore?
tar -xzvf /backup/013004.tar.gz /home/accounting/yearend.xls
A number of new filesystems have been added to the server and you want them to be active now. You also do not want to bring the server down. Which command makes the changes active?
mount -a
Which command displays information about the RAID devices on the computer?
hwinfo –listmd
You are using YUM, and you need to determine which package contains the /usr/lib/libstlport_gcc.so file. Which command should you type at the command prompt?
yum whatprovides /user/lib/libstlport_gcc.so
You have installed a package called mathpac with apt-get. After a system upgrade, the package is not working correctly. Which command is the most correct option to get the package to work?
apt-get upgrade mathpac
You want to issue a simple command to replace all the occurrences of the string foo with the string bar in the file myfile.txt. You have decided to use sed. Whch line will work?
sed -e ‘s/foo/bar/g’ myfile.txt
You need to view the files within /home/gshant/expfile.bz2, but you want to leave the compressed file unchanged. What bzip2 options should you use?
-k
You are requested to help a user who reports that he has no more local storage space. You go to his system and log in as root user. Which command will display the available disk space on all partitions?
df
df-h
You want to view partition information for your sda device. Which commands could you used to view the partitions defined on sda?
fdisk -l
fdisk /dev/sda, then press p
You need Yellowdog Updater Modified (YUM) utility to check specific URLs for RPM repositories. Where should you add the URLs?
within the etc/yum.conf file
Which daemon allows processes to communicate with each other and rely information about hotplug decices?
D-Bus
Which of the following is not a characteristic of symbolic links?
valid inode for the file data even if the original file is deleted
Which of the following devices represent a hotplug device?
USB flash drives
Which of the following commands starts gedit with a priority 1 about the defult nice priority?
nice -n -1 gedit
Which kill option stops and restarts the process with the same Process ID (PID)?
-SIGHUP
You need to obtain specific information found in the columns of ~/smarts. Which of the following commands should you used?
cut -f ~/smarts
You need to configure a few changes to how the locatedb index file is created. Which file should you edit?
/etc/updatedb.conf
Which command reads from standard input and writes to standard output and files?
tee
You want to restore files with the extension .cfg from an archive called configs.cpio. Which command will perform the restore?
cpio -ivd “*.cfg” < /mnt/hdd2/configs.cpio
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. 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
You are preparing to use a logical volume with LVM. Which of the following commands creates a volume group named backup on the third disk in the system?
vgcreate backup /dev /sdc
Which utility runs at startup to load modules into kernal?
modprobe

Get instant access to
all materials

Become a Member