QuestionsLinux Essentials
QuestionsLinux Essentials
o LibreOffice*
6. POP and IMAP are related to:
o Sharing files
o Email*
o Reading and writing music
o Serving web pages
o Letting users log in to multiple servers with 1 set of credentials
7. When a computer boots, it can get its network information through:
o X11
o DNS
o DHCP*
o LDAP
o SMTP
8. Which of the following are examples of text editors? (choose four)
o pico*
o emacs*
o yum
o vim*
o nano*
9. A package manager: (choose two)
o Downloads software from the Internet*
o Emails you when software is out of date
o Keeps track of which files belong to which packages*
o Can optionally repartition your disk to make room for Linux
o Performs a fresh install of Linux
10. An interpreted programming language: (choose two)
o Takes fewer resources to run than a compiled language
o Tends to offer more features than compiled languages*
o Is converted into machine specific instructions as the program runs*
o Requires a linking step but no compilation step
o Requires a compilation step but no linking step
11. Which of the following are true about compiled programming languages?
o Compiled languages are great for system administration tasks like
scripting
o C is a compiled language*
o Ruby is a compiled language
o Perl is a compiled language
o A programmer is usually more productive when using a compiled
language
12. Which package manager is used in Fedora, a Red Hat derived system?
o vim
o tar
o apt-get
o bash
o yum*
13. The Linux shell: (choose three)
6
o Microsoft
o The Free Software Foundation*
o BSD Unix
o The Apache foundation
21. A “copyleft provision” in a software license means:
o If you redistribute the software, you must distribute the source to any
changes you make*
o You may not link against third party closed source software
o You must provide free copies of the software if you use it
o You must provide support for your modifications
o You give up your copyright to the software
22. The largest difference between the GPLv2 and BSD licenses is:
o GPLv2 is not approved by the OSI
o Only BSD allows commercial use
o Nothing, they are virtually identical
o BSD has no copyleft provision*
o GPLv2 requires assigning copyright to the FSF
23. The Free Software Foundation believes that: (choose two)
o Software should be free to modify*
o No money should ever change hands
o Software should be free to share*
o People should write software with no expectation of making money
o Software should not have copyright
24. Which of the following licenses was made by the FSF?
o MIT
o BSD
o GPLv3*
o Creative Commons
o Apache
25. A permissive free software license: (choose two)
o Means you can use the software for anything you want*
o Does not allow the software to be locked to certain hardware
o Places no restrictions on sharing modifications*
o Places the software in the public domain
o Requires you share software changes but not binaries
26. Linux is distributed under which license?
o Linux Foundation
o MIT
o BSD
o GPLv2*
o GPLv3
27. Who founded the Open Source Initiative? (choose two)
o Richard Stallman
o University of California at Berkeley
o Eric Raymond*
o Linus Torvalds
8
o Bruce Perens*
28. A generic term for Open Source and Free Software is:
o SLOFF
o Libre Software
o FLOSS*
o GPL
o OS/FS
29. Which are examples of permissive software licenses? (choose two)
o GPLv3
o GPLv2
o LGPLv3
o MIT*
o BSD*
30. What does it mean when a work is placed in the public domain?
o The work was done by a government agency
o The author has died
o You must redistribute changes to the software
o You may not use the work for commercial purposes
o The author has relinquished the copyright on the work*
31. Creative Commons licenses allow you to: (choose three)
o Specify whether or not people may distribute changes*
o Receive royalties on the use of the work
o Specify whether or not changes must be shared*
o Allow or disallow commercial use*
o Get a veto on where the work is used
32. If a podcast is licensed under the CC BY-ND license, you may: (choose two)
o Use an interview or song from it for your own podcast
o Post it to your website*
o Add ads to it and post it to your website.
o Share it as long as you give credit to the author*
o Sell it as part of a compilation
33. How can you make money from open source software? (choose three)
o Charge a yearly fee for the right to use the software
o Take payments for fixing bugs*
o Sell hardware that’s built to work with the software*
o Provide paid consulting services for users*
o Unlock premium features for people that pay
34. To place software under an open source license, you must give up your
copyright.True or False?
o True
o False*
35. The difference between the GPL and LGPL licenses are:
o LGPL is shorter than GPL
o LGPL allows linking to non GPLed software*
o LGPL applies to web services
o LGPL was made by the OSI while GPL was made by the FSF
9
o False*
10. To be able to output messages to the screen, use the _______ command:
o display
o type
o print
o echo*
11. The _______ command will print a list of the commands that you’ve
previously executed.
o eval
o history*
o list
o exec
12. To execute the same command as previously executed five commands ago, you
would type:
o &5
o !-5
o @-5
o !5
13. The shell program interprets the commands you type into the terminal, into
instructions that the Linux operating system can execute.True or False?
o True*
o False
14. The acronym CLI stands for:
o Command Line Interpreter
o Computer Link Interpreter
o Computer Line Interface
o Command Line Interface*
15. Traditional UNIX command options used a single dash, like -a; _______
command options use two dashes like –all.
o LINUX
o Kernel
o GNU *
o shell
16. The acronym GNU stands for:
o Gnu’s Not Unix*
o Good News Unix
o Gnu’s Nearly Unix
o Go Next Unit
17. What one character treats the character that follows it as if it was surrounded
by single quotes?
o #
o /
o %
o \
18. The main purpose of using glob characters is to be able to provide a command
a list of filenames.True or False?
14
o True*
o False
o g
o z
o a
o h*
18. To exit the info page, press:
o X
o x
o q*
o z
19. In order to search an info page, the first key to press is: (choose one)
o f
o t
o s*
o g
20. To go to the end of an info page, press:
o N
o END*
o ]
o n
21. To go to the next match of a search on a man page, press:
o N
o ]
o }
o n*
22. When interpreting the SYNOPSIS of a command found on a man page, the “|”
means:
o The items it separates cannot be used together*
o The items it separates can be used together
23. After performing a search, you can use the ____ key to return to a previously
found match:
o N*
o U
o n
o D
24. To move a page forward one at a time while viewing a man page, press the
following:
o Spacebar*
o m
o Enter
o A
17
19. When using the cp command, you must provide both a source and a
destination.
True or False?
o True*
o False
20. Which option(s) can be used to prevent cp from overwriting an existing file?
(choose two)
o -n *
o -N
o -z
o -i *
21. The command rm -r will…
o remove a directory along with any files or subdirectories.*
o prompt for each confirmation before deleting each file in a directory.
o remove only empty directories.
o generate an error; -r isn’t a valid option.
22. Which option can be used with the rm command to prompt before deleting?
o -i *
o I
o -P
o A
23. The rm command can delete multiple files at once.
True or False?
o True*
o False
24. Which of the following commands can be used to rename a file?
o name
o mv*
o rn
o cp
25. The touch command can be used to: (choose two)
o Create new files*
o Change a file’s name
o Update the time stamp of existing files*
o Change ownership of a file
o -H
o -w
o -a *
3. The top-level directory on a Linux system is represented as:
o /
o C:
o /home
o /root
4. Is the following path absolute or relative?
/etc/ppp
o Absolute*
o Relative
5. Is the following path absolute or relative?
sysadmin/Documents
o Relative*
o Absolute
6. Is the following path absolute or relative?
../../home/sysadmin
o Relative*
o Absolute
7. The tilde (~) is used to represent:
o A user’s home directory*
o Any two single characters
o The directory above the current working directory
o Nothing; it has no special meaning
8. Which of the following commands can be used to access the home directory of
the user “bob” while logged in as root? (choose two)
o cd /home/bob*
o cd ~bob*
o cd &&
o ~bob
9. The double dot (..) can be used with the cd command to represent:
o The directory above the current working directory*
o Nothing; it has no special meaning.
o Any two single characters
o A user’s home directory.
10. The cd command by itself will take you to what directory?
o The system root directory
o None; it is not a valid command
o The directory above the current working directory
o Your home directory*
11. What command will allow you to change your current working directory?
o chdir
o list
o cd *
o ls
21
12. The double dot (..) can be used to represent the directory…
o …above the current directory.*
o …below the current directory.
o …with any two single numbers.
o …above the current directory only when using the cd command.
13. The ls command without options or arguments…
o …generates an error as this command requires arguments.
o …lists the contents of the current directory.*
o …prompts for a directory to list.
o …lists the contents of a user’s home directory.
14. The first character in a long listing (ls -l) indicates:
o The permissions
o If something is a file, directory, or symbolic link*
o The owner
o The size
15. Which option for the ls command, when used in conjunction with the -l option,
will display human-readable sizes?
o -M
o -S
o -H
o -h *
16. Which of the following commands will prevent any aliased options to the ls
command?
o /ls
o \ls *
o %ls
o ls
17. The ls command color codes results by default.
True or False?
o True
o False *
18. The command ls -S will sort files:
o By size, smallest to largest
o By number of symlinks, largest to smallest
o By modification date, newest to oldest
o By size, largest to smallest*
19. When using the cp command, you must provide both a source and a
destination.
True or False?
o True*
o False
20. Which option(s) can be used to prevent cp from overwriting an existing file?
(choose two)
o -n *
o -N
o -z
22
o -i *
21. The command rm -r will…
o remove a directory along with any files or subdirectories.*
o prompt for each confirmation before deleting each file in a directory.
o remove only empty directories.
o generate an error; -r isn’t a valid option.
22. Which option can be used with the rm command to prompt before deleting?
o -i *
o I
o -P
o A
23. The rm command can delete multiple files at once.
True or False?
o True*
o False
24. Which of the following commands can be used to rename a file?
o name
o mv*
o rn
o cp
25. The touch command can be used to: (choose two)
o Create new files*
o Change a file’s name
o Update the time stamp of existing files*
o Change ownership of a file
13. Which of the following commands will display lines that contain either start or
end?
o egrep start end file.txt
o egrep ‘start|end’ file.txt*
o egrep start&end file.txt
o egrep (start|end) file.txt
14. Which of the following commands can be used to scroll through a text file?
(choose two)
o some
o less*
o cat
o more*
15. The find command can search for files based on the size of the file.True or
False?
o True*
o False
16. Which of the following commands scans the file to determine file locations?
o search
o locate
o where
o find*
17. Which option for the cut command is used to specify a delimiter?
o -f
o -d *
o =
o -D
18. Which option for the cut command is used to specify the field?
o -D
o -f *
o -d
o #
19. Which option for the wc command will print the number of lines in a file?
o -l *
o -w
o -C
o -L
20. Which option for the wc command will print the total number of words in a
file?
o -l
o -L
o -C
o -w *
21. Which command can be used to print line numbers?
o num
o sort
o ln
25
o nl*
22. The command echo “text” > file.txt will create file.txt if it does not already
exist.True or False?
o True*
o False
23. The command echo “text” > file.txt will not overwrite file.txt if it already
exists.True or False?
o True
o False*
24. The command echo “text” >> file.txt will not overwrite file.txt if it already
exists.True or False?
o True*
o False
o $1
o read*
o input
o gets
12. What information is held inside $? ?
o The current process id
o The number of arguments passed to the script
o The current user ID
o The previous command’s exit code*
o The name of the command run
13. How would you finish your script with an exit code of 42?
o return 42
o $?=42
o CODE=42
o exit 42*
o break 42
14. The if command looks for what exit code to consider a condition to be true?
o 10
o 255
o 0*
o 1
o 8
15. The number of users logged in is in a variable called USERS. How would you
test to see if 5 users are logged in?
o test –f USERS=5
o test $USERS = 5
o test $USERS,5
o test $USERS –eq 5 *
o test $USERS –a 5
16. Given the following script:
while [ ! –f /tmp/foo ]; do
echo –n “.”
process_data > /tmp/foo
done
Which of the following are true? (choose two)
o If a file called /tmp/foo exists, process_data won’t be run*
o The screen will fill with dots.
o /tmp/foo will be removed if it exists
o process_data will never be run
o process_data will be called at most once*
17. A conditional that lets you make multiple comparisons with a pattern is
called:
o case*
o fanout
o if
o test
28
o branch
18. What is the meaning of $(( $i + 1)) ?
o 1 will be added to the i variable*
o This will return the value of the next argument to the script
o This runs the command stored in variable i
o If i is 0, the loop will stop
o This will return the value of the first argument to the script
19. How would you write a test that says “if /tmp/foo is a directory or USERS is
greater than 5”?
o test –d /tmp/foo | $USERS > 5
o test –f /tmp/foo –o $USERS –ge 5
o test –d /tmp/foo –o $USERS –gt 5 *
o test /tmp/foo || $USERS > 5
o test /tmp/foo –d –o $USERS -gt 5
o 1 minute *
o 10 minute
o 15 minute *
11. The free command outputs statistics about:
o Software usage
o Memory usage *
o Disk usage
o CPU usage
12. What directory typically contains log files?
o /proc/log
o /var/log *
o /usr/log
o /log
13. Which log file contains messages regarding authentication and authorization?
o secure *
o messages
o syslog
o dmesg
14. All log files contain only text data.True or False?
o True
o False *
15. A load average of 1.0 always means the system is fully loaded.True or False?
o True
o False *
16. A command that will continuously update statistics about running processes:
o head
o top *
o tail
o bottom
17. The following are valid Linux option styles: (choose three)
o DOS slash (/)
o BSD Unix without a dash *
o Traditional Unix with a single dash (-) *
o GNU long options with two dashes (–) *
18. Which file contains the information passed to the kernel at boot time?
o /proc/cmdline *
o /proc/kernel
o /proc/kargs
o /proc/kopts
19. To make changes permanent for kernel parameter files found under
/proc/sys, the following file can have entries added to it:
o /etc/procsys.conf
o /etc/procctl.conf
o /etc/sysinfo.conf
o /etc/sysctl.conf *
32
20. To get a list of all packages installed on a system using RPM Package
Management you can execute:
o rpm -ql
o rpm -qa *
o rpm -qf
o rpm -qi
o dig
o ifconfig*
o route
9. Which of the following commands will display the routing table? (choose two)
o netstat -r*
o dig
o ifconfig
o route*
10. Which of the following commands will allow you to log into a remote
machine?
o route
o ssh*
o dig
o netstat
11. What option to the netstat command has information shown as numbers
rather than names?
o –name
o -r
o -n *
o -t
12. Which of the following commands will allow you to log into the machine
server1 with the account name nick?
o ssh nick->server1
o ssh nick&server1
o ssh nick-server1
o ssh nick@server1*
13. The RSA key fingerprint allows the dig command to connect to remote systems.
True or False?
o True
o False*
o who
o whoami
o about
4. Each user belongs to at least one group.
True or False?
o True*
o False
5. Which command will display the users that are currently logged in to the
system?
o whoami
o about
o who*
o id
6. The sudo command allows regular users to…
o …run any command as root, after providing the sudo password.
o …run certain commands as the root user.*
o …run any command as root, after providing the root password.
o …run any commands as a system account without logging in.
7. The /etc/sudoers file should be edited directly by root using the visudo
command.
True or False?
o True*
o False
8. Which of the following commands will allow you to switch to the user, branch?
(choose three)
o sudo branch
o su – branch*
o su -l branch*
o su branch*
9. The visudo command uses which text editor by default?
o vi*
o nano
o pico
o gedit
10. Which of the following commands will display the group(s) a user belongs to?
o group
o id*
o all
o whoami
11. Which of the following commands will display the groups that the user bob
belongs to? (choose one)
o groups -a
o id bob*
o group bob
o all bob
12. The /etc/group file follows what structure?
35
o groups -a
o user:group
o group:GID:user_list
o group_name:password_placeholder:GID:user_list*
13. A GID is associated with a group name.
True or False?
o True*
o False
14. A user can belong to…
o Only five groups
o Only one group
o At least 16 groups*
o Only groups with a GID over 500
15. Sudo privileges can be used to specify which user can use the sudo command
to execute commands as other users.
True or False?
o True*
o False
16. In distributions that do not allow the root user to login directly or via the su
command, the installation process automatically configures one user account
to be able to use the sudo command to execute commands as if they were
executed by the root user.
True or False?
o True*
o False
17. Which of the following commands will display how long the system has been
running since the last boot? (choose two)
o id
o w*
o who
o uptime*
18. The /etc/shadow file contains plain-text passwords.
True or False?
o True
o False*
19. Which command can be used to view the /etc/passwd file entries?
o getent*
o uppasswd
o uptime
o getpasswd
o Are not used for user accounts, but for group accounts
o Log-in (human) users
o Remote log-in accounts
2. If a user is deleted, the files and directories that the user owned…
o …will show a UID as the owner, but not user name.*
o …will have no UID owner.
o …are deleted as well.
o …will have no user owner.
3. Which of the following options for the useradd command allows root to specify
the UID to be associated with the account?
o -U
o -u*
o -G
o -g
4. Which of the following options for the useradd command allows root to specify
supplementary groups the user will be a member of?
o -G*
o -u
o U
o -g
5. On a system that does not use UPG, the useradd command will also create a
user group. For example, user bob, group bob.
True or False?
o True
o False*
6. The useradd command will create a home directory by default for a user.
True or False?
o True*
o False
7. The usermod command can be used to do all of the following except…
o …add a user to a supplementary group.
o …change the user’s MAX and MIN password settings.*
o …change the user’s home directory.
o …change the user’s UID and GID.
8. Which of the following commands will add the group extra to the user bob’s
secondary groups in addition to bob’s current secondary groups?
o usermod -G extra bob
o usermod -a extra bob
o usermod -aG extra bob*
o usermod -ag bob extra
9. Which option for the usermod command can be used to specify a user’s group
ID (either primary or secondary)? (choose two)
o -g*
o -G*
o -s
o -S
37
10. For non-root users, the passwd command can only be used to change the
password of the user running the command.True or False?
o True*
o False
11. The userdel command will…
o …delete the user account, but leave the user’s files by default.*
o …will prompt before deleting each file owned by a user.
o …automatically delete a user and the user’s home directory and its
contents.
o …automatically delete a user and all the files owned by that user.
12. The groupmod command can be used to change a group name.
True or False?
o True*
o False
13. The groupmod command can be used to change a group GID.
True or False?
o True*
o False
14. The groupmod command can be used to add users to a group.
True or False?
o True
o False*
15. Which of the following commands can be used to modify a group?
o groupadd
o modgroup
o addgroup
o groupmod*
16. Which command can be used to determine a user’s most recent log in?
o last*
o history
o shell
o login
17. Which of the following files contains encrypted user password information?
o /etc/usr
o /etc/shadow*
o /etc/passwd
o /etc/group
18. Which of the following files contains user IDs?
o /etc/group
o /etc/shadow
o /etc/usr
o /etc/passwd*
19. Which of the following files does the groupadd command use to determine the
new GID when a GID isn’t specified?
o /etc/shadow
o /etc/group*
38
o /etc/passwd
o /etc/usr
20. Which of the following commands, run as root, will prevent the user bob from
logging in?
o usermod -d bob
o usermod -l bob
o usermod -D bob
o usermod -L bob*
21. What directory contains user’s home directories?
o /
o /home*
o /rootfs
o /user
7. The user sysadmin will be able to read the file because they own it.
—-r–r– 1 sysadmin group 38270 Sep 2 18:49 file
True or False?
o True
o False*
8. The user sysadmin will be able to change the permissions of the file because
they own it.
—-r–r– 1 sysadmin group 38270 Sep 2 18:49 file
True or False?
o True*
o False
9. Octal notation uses the following values for the permissions granted:
o r = 4, w = 2, x = 1*
o r = 7, w = 5, x = 0
o r = 3, w = 2, x = 1
o r = 4, w = 2, x = 0
10. Which of the following permissions would allow all users to add, view, and
delete files in a directory?
o 666
o 775
o 750
o 777*
11. A user cannot delete a file if they do not own it.
True or False?
o True
o False*
12. The “execute” permission on a directory allows you to: (choose three)
o Change to that directory or use it as part of a path*
o Along with write permission to successfully delete the directory
o Along with read permission to successfully perform ls -l*
o Along with write permission to successfully create new files*
13. The “execute” permission on a file allows you to:
o Run the file as a script*
o This permission isn’t meaningful for text files.
o Delete the file
o Move the file to a new directory
14. The chgrp command can be used on a file by:
o Only root
o A user that belongs to the files current group
o The file owner and root*
o Only the file owner
15. The chown command can be used to change the user owner on a file by:
o Only root*
o A user that belongs to the files current group
o The file owner and root
o The file owner
40
o ln file link*
o ln -s link file
o ln -s file link
o ln link file
15. Which of the following commands would create a symbolic link, link to file?
o ln -s link file
o ln file link
o ln -s file link*
o ln link file