The document provides answers to exam questions about Linux essentials. It covers topics like Linux distributions, embedded systems, mobile Linux platforms, package managers, shells and common Linux software. Example answers are given for multiple choice questions.
The document provides answers to exam questions about Linux essentials. It covers topics like Linux distributions, embedded systems, mobile Linux platforms, package managers, shells and common Linux software. Example answers are given for multiple choice questions.
1. When choosing a distribution of Linux, you should consider: (choose four) Does your organization require long-term support for the system Does the distribution offer a “stable” version If the application software is supported by the distribution Will commercial support be required for the OS Popularity on social media 2. Embedded Systems means: Users must support the systems themselves You can view the software’s source code Companies must share their changes Businesses cannot charge anything for the software, only the hardware Systems designed to do a specific task on hardware optimized for only that purpose 3. The most popular Linux platform for mobile phones is: IOS Android BlackBerry Slackware MobileLinux 4. Linux distributions use this to add and remove software from the system: Application Programming Interface (API) Partitioning tool Package manager Bash Compiler 5. In Linux, RPM can be defined as: Random program memory Relational peak monitoring Radical performance machine The speed a record plays back at The Package Manager program for Red Hat Linux 6. Linux originally only ran on: Macintosh Intel 386 PCs Raspberry Pi computers Specialized processor chips Xerox copy machines 7. A long software release cycle is: Better because old hardware can be utilized beyond its service life Only offered by Red Hat and SUSE Makes programming more difficult since new features cannot be used Valued by businesses that want stability Characterized by infrequent security fixes 8. Which distribution is related to Red Hat? Raspbian Debian Ubuntu Slackware Fedora 9. SUSE is derived from which distribution? Fedora Debian Red Hat Enterprise Linux Slackware Scientific Linux 10. IoT is one application of embedded systems: True or False? True False 11. Artificial intelligence has little potential for gains in efficiency, safety and productivity. True False 12. The Raspberry Pi is popular with experimenters because: It runs Microsoft Office End users have to pay for programming expenses It’s cheap and adaptable The hardware never changes It takes months or years to develop an application 13. The release cycle: Only has meaning for paid software Should be short so you always have the freshest releases Should be long so that you have time before you need to upgrade Describes how long software will be supported Dictates how often software is updated 14. Debian is a community effort that supports many hardware platforms True or False? True False 15. Linux Mint is: Compatible with Android systems A fork of Ubuntu Linux A proprietary version of Ubuntu with advanced features A refreshing after dinner treat Distributed in every country without license restrictions 16. A computer running Linux can: Outperform proprietary systems at certain tasks All of the above Function as a web server Serve a government agency Be used to create new programs 17. Bundling utilities, management tools, and application software with a Linux kernel is called a: A distribution of Linux A text editor A type of hardware A trademark 18. A network of inexpensive computers connected to sensors and controllers is called: Internet of Things (IoT) Creative commons Open source networking Closed source computing Relationational database 19. The Linux platform that runs on mobile phones is called: MicroLinux IOS Android Teledroid LinuxMobile 20. What does a distribution provide to add and remove software from the system? Compiler Application Programming Interface (API) Bash Package Manager Partitioning tool 21. A software release cycle describes: How often upgrades come out for software How often the software’s memory is released back to the operating system How often the computer must be upgraded to support new software How often security fixes are implemented How often the computer must be rebooted 22. Which distributions are made by, or are clones of, RedHat? (choose two) Debian CentOS Fedora Ubuntu Slackware 23. Ubuntu is derived from which distribution? Slackware Debian Scientific Linux Red Hat Enterprise Linux 24. The most important consideration when choosing an operating system is: What the intended use of the system is How much performance is needed The licensing model of the operating system The total cost of ownership Whether or not it is cloud-friendly 25. A maintenance cycle: Describes how often updates for software come out Should be short so you always have the freshest releases Only has meaning for paid software Should be long so that you have time before you need to upgrade Describes how long a version of software will be supported 26. If a software release is in a state in that it has many new features that have not been rigorously tested, it is typically referred to as beta software. True or False? True False 27. Software is backward compatible if: It can be upgraded without downtime People still use old versions It still supports old file formats or applications If the next version still works the same way It works across Linux/Mac/Windows 28. Apple’s OS X is: (choose three) Derived from Linux Able to natively run Windows binaries Primarily used to manage network services A fully certified UNIX distribution Tightly integrated with Apple hardware Partially based on code from the FreeBSD project 29. Microsoft Windows: (choose three) Has a scripting environment called PowerShell Is generally backwards compatible with previous versions Offers both desktop and server products Has a short maintenance cycle Has a Linux compatibility mode Has a new desktop version every year. 30. When choosing a distribution of Linux, you should consider: (choose five) Does the distribution offer a “stable” version Will users require a GUI Will commercial support be required for the OS Does your organization require long-term support for the system Popularity on social media If the application software is supported by the distribution NDG Linux Essentials 2.0 Chapter 3 Exam Answers 1. The Samba application is a: Security Server File Server Mail Server Web Server 2. Which of the following are examples of desktop software? (choose two) Music player File share Web browser Compiler Web server 3. If you wanted to set up a blog, which software would be most helpful? Samba MySQL Postfix Dovecot WordPress 4. Which of the following pieces of software deal with file sharing? (choose three) X-Windows PostgreSQL Netatalk Samba NFS 5. If you wanted to create and print an invoice, which software could you use? Evolution LibreOffice GNOME Compiz Firefox 6. POP and IMAP are related to: Serving web pages Reading and writing music Email Letting users log in to multiple servers with 1 set of credentials Sharing files 7. When a computer boots, it can get its network information through: LDAP DNS DHCP SMTP X11 8. Which of the following are examples of text editors? (choose four) nano Yum pico vim emacs 9. A package manager: (choose two) Downloads software from the Internet Keeps track of which files belong to which packages Can optionally repartition your disk to make room for Linux Performs a fresh install of Linux Emails you when software is out of date 10. An interpreted programming language: (choose two) Takes fewer resources to run than a compiled language Is converted into machine specific instructions as the program runs Requires a linking step but no compilation step Tends to offer more features than compiled languages Requires a compilation step but no linking step 11. Which of the following are true about compiled programming languages? Ruby is a compiled language Compiled languages are great for system administration tasks like scripting C is a compiled language Perl is a compiled language A programmer is usually more productive when using a compiled language 12. Which package manager is used in Fedora, a Red Hat derived system? tar bash yum vim apt-get 13. The Linux shell: (choose three) Is customizable Has a built-in text editor Allows you to launch programs Has a scripting language Is responsible for tracking the location of configuration files 14. Which application would you use to edit and piece together sound files to make a podcast? Audiolicious GIMP Thunderbird Bash Audacity 15. The two main families of Linux shells are: (choose two) Emacs C Shell Bourne Shell Python Shell Korn shell 16. Which server software would you use to create a company directory that you could search and authenticate against? bind OpenLDAP Samba ISC DHCP Netatalk 17. A Mail Transfer Agent’s primary purpose is to: Serve email to end clients Deliver mail between servers Manage the end user’s inbox Filter out spam Act as a gateway between faxes and email 18. Which of the following are examples of a web server? (choose two) NFS postfix WordPress Nginx Apache 19. If you wanted to let a Linux machine share files with Windows clients and servers, you would use: Netatalk DNS Samba NFS bind 20. Virtualization means: A user can connect to a server over the network and use a virtual console Many users can share one hard drive A machine can swap memory to disk A single host can be split up into multiple guests Two users get different memory spaces on the same machine 21. In virtualization, what are the host and guest? (choose two) The terms can be used interchangeably A guest is a virtual machine A host is a virtual machine The host is the machine that runs the virtual machines The guest is the machine that runs the virtual machines 22. Which of the following are traits of cloud computing? (choose two) You don’t have to worry about performance any more Resources can be accessed from anywhere over a network Scales IT resources so you pay for what you use You own the hardware but pay for it over time Only Linux works in cloud computing 23. If you wanted to write a report that was to be printed, you would probably use: A wiki Adobe Flash Firefox Chrome LibreOffice 24. To protect your privacy online, you can configure your computer to check for updates periodically. True or False? True False 25. Which of the following is a tool that helps you anonymize your Internet browsing? Web proxy Tor Browser Iptables AnonFirefox CookieCleaner 26. Cloud computing is: Is made possible by faster internet speeds Is useful for both business and home users Allows users in different geographical regions to work together in real time Requires fewer resources because systems are shared among many users All are correct 27. The term for individual computers running multiple systems at the same time is: MultiRun Cloud priority Distribution Virtualization Googleization 28. Which of the following are traits of a multiuser operating system? (choose three) Many users can log in simultaneously with a unique account Users can protect their information from other users Resources are shared between users Each user can only log in once per day An administrative user gets a dedicated CPU 29. If you want to store logins and passwords for different websites in a secure manner, you could use: A text file in your home directory A LibreOffice document A sticky note on your monitor KeePassX In a spiral bound notebook in your file cabinet 30. Two components that provide the ability to implement a firewall include: (choose two) iptables gufw ifconfig Cerberus ipfw 31. What are tradeoffs of increasing the level of privacy you have in your web browser? (choose two) You may have to explicitly permit some cookies to be saved Sites may not work properly You may get viruses Websites may load slower Images won’t load properly 32. Social network “like”• buttons can track your activity across the Internet. True or False? True False 33. Which of the following are properties of a strong password? (choose three) At least 10 characters long Based on easy to remember items like birthdays Includes symbols Long so that it can be reused on multiple sites A mix of upper and lower case 34. What can be done to prevent unauthorized users from accessing your computer remotely? (choose two) Block third party cookies Turn on a firewall Block all cookies Use strong passwords on all user accounts Don’t use wireless networks – only wired 35. In graphical mode, you can get to a shell by running which applications? (choose two) Terminal Gbash console Xterm Guiterm
NDG Linux Essentials 2.0 Chapter 4 Exam Answers
1. Linux source code is available to: Employees of the FBI, CIA and NSA with top secret clearance Anyone who has the knowledge needed to access it Only university researchers with a government grant Only employees of the Linux Foundation 2. Source code refers to: The version of a program that the computer runs on the CPU The interface that software uses to talk to the kernel The license that dictates how you may use and share the software A human-readable version of computer software 3. Open source means: (choose two) You can view the software’s source code You must share your changes You can modify the software’s source code You cannot charge anything for the software You must support the software you share 4. A license where you don’t have access to the source code is called: Impaired source Closed source Open source Sourceless 5. Open source licenses differ, but generally agree that: (choose two) You are not allowed to sell the software You must redistribute your changes You should be able modify the software as you wish You should have access to the source code of software 6. Richard Stallman is associated with: BSD Unix Microsoft The Free Software Foundation The Apache foundation The Open Source Initiative 7. A copyleft provision in a software license means: You may not link against third party closed source software If you redistribute the software, you must distribute the source to any changes you make You must provide free copies of the software if you use it You must provide support for your modifications You give up your copyright to the software 8. The largest difference between the GPLv2 and BSD licenses is: Nothing, they are virtually identical BSD has no copyleft provision GPLv2 requires assigning copyright to the FSF GPLv2 is not approved by the OSI Only BSD allows commercial use 9. The Free Software Foundation believes that: (choose two) Software should be free to modify Software should be free to share Software should not have copyright People should write software with no expectation of making money No money should ever change hands 10. Which of the following licenses was made by the FSF? Creative Commons GPLv3 Apache BSD MIT 11. A permissive free software license: (choose two) Means you can use the software for anything you want Does not allow the software to be locked to certain hardware Places the software in the public domain Places no restrictions on sharing modifications Requires you share software changes but not binaries 12. Linux is distributed under which license? GPLv3 BSD Linux Foundation MIT GPLv2 13. Who founded the Open Source Initiative? (choose two) University of California at Berkeley Richard Stallman Bruce Perens Linus Torvalds Eric Raymond 14. A generic term for Open Source and Free Software is: SLOFF OS/FS FLOSS GPL Libre Software 15. Which are examples of permissive software licenses? (choose two) BSD LGPLv3 GPLv3 GPLv2 MIT 16. What does it mean when a work is placed in the public domain? The work was done by a government agency You may not use the work for commercial purposes The author has died The author has relinquished the copyright on the work You must redistribute changes to the software 17. Creative Commons licenses allow you to: (choose three) Specify whether or not people may distribute changes Receive royalties on the use of the work Allow or disallow commercial use Specify whether or not changes must be shared Get a veto on where the work is used 18. If a podcast is licensed under the CC BY-ND license, you may: (choose two) Use an interview or song from it for your own podcast Post it to your website Share it as long as you give credit to the author Sell it as part of a compilation Add ads to it and post it to your website. 19. How can you make money from open source software? (choose three) Unlock premium features for people that pay Sell hardware that’s built to work with the software Take payments for fixing bugs Charge a yearly fee for the right to use the software Provide paid consulting services for users 20. The difference between the GPL and LGPL licenses are: LGPL applies to web services LGPL ensures that all variants of the original GPL program has the same freedom of use as the original LGPL allows you to distribute the software in binary-only form LGPL is shorter than GPL LGPL was made by the OSI while GPL was made by the FSF 21. Permissive free software licenses: (choose three) Can allow software to be used inside closed source software Include the GPLv2 and BSD Are not approved by the FSF Don’t have a copyleft provision Are not approved by the OSI 22. The Creative Commons version of Public Domain licensing is: NoAttribution-ShareAlike (CC BY-SA) Attribution-NonCommercial (CC BY-NC) Attribution (CC BY) No Rights Reserved (CC0) Attribution-NonCommercial-ShareAlike (CC BY-NC-SA) 23. Your company makes a hardware firewall that runs a custom Linux kernel. What are your obligations under GPLv2? You must ensure your custom kernel runs on a regular Intel machine There are no requirements You must make the source to your kernel available You must make your hardware designs available You must make the source to your custom web interface available
NDG Linux Essentials 2.0 Chapter 5 Exam Answers
1. Which environment variable contains a list of directories that is searched for commands to execute? PATH PS1 PS2 EXEC 2. Select the command that can report the location of a command: what which where 3. A pair of single quotes ( ‘ ) will prevent the shell from interpreting any metacharacter. True or False? True False 4. A pair of double quotes (” ) will prevent the shell from interpreting any metacharacter. True or False? True False 5. Using a pair of back quotes ( ` ) will cause a shell to execute the back- quoted text as a command and substitute the output back into the original command. True or False? True False 6. The semicolon (;) can be used to separate multiple commands to be executed in order. True or False? True False 7. The double ampersand characters (&& ) are used to separate commands to be executed conditionally, where if the command to the left of the ampersands fails, then the command to the right of the ampersands will be executed. True or False? True False 8. To be able to output messages to the screen, use the _______ command: echo print display type 9. The _______ command will print a list of the commands that you’ve previously executed. list eval history exec 10. To execute the same command as previously executed five commands ago, you would type: @-5 !5 !-5 &5 11. The shell program interprets the commands you type into the terminal into instructions that the Linux operating system can execute. True or False? True False 12. The acronym CLI stands for: Computer Line Interface Command Line Interpreter Command Line Interface Computer Link Interpreter 13. What one character treats the character that follows it as if it was surrounded by single quotes? / # % \ 14. The echo command: Copies variables from one to another Tests a variable for duplication Is used for variable assignment Is used to output text to the console Duplicates the input stream to the output stream 15. The most common shell used for Linux distributions is the ________ shell. Fish Bash Tsch Zsh 16. HOME is an example of _________. An environment variable A path variable A local variable An internal command An alias NDG Linux Essentials 2.0 Chapter 6 Exam Answers 1. What is the standard option to provide a command line program to view its documentation? -h –info –help –doc 2. The command man -k is the same as the command apropos. True or False? True False 3. The whatis command is the same as man -w. False True 4. The directory where additional documentation for software packages most likely can be found is: /usr/software/doc /var/lib/doc /usr/share/doc /var/share/doc 5. Which two pager commands are used by the man command to control movement within the document? (choose two) grep less page more 6. Commands typically executed by a user are covered in what section of the manual? 5 3 2 1 7. To search the man page sections for the keyword example, which of the following command lines could you execute? (choose two) man -k example apropos example man -f example whatis example 8. The statement that describes the difference between a man page and an info page is: The man page is like a guide; the info page is a more concise reference. The info page is like a guide; a man page is a more concise reference. The man page is a long detailed reference; the info page is very terse. There is very little difference between them. 9. If you are reading the synopsis of a command from a man page, then items in square brackets are: Required arguments Comments Optional Required options 10. The following sections commonly appear on a man page: (choose three) NAME LICENSE DESCRIPTION SYNOPSIS 11. Section 5 of the manual pages covers: System administration commands Games User commands File Formats 12. To start searching a man page, the first key you press is: f / s ! 13. In order to exit viewing a man page, press: q z x y 14. To get help on using the info command, execute: (choose two) man info info -q info info help info 15. To get help while using the info command, press: g A Shift+H Shift+z 16. To exit the info page, press: Q x z x 17. When interpreting the SYNOPSIS of a command found on a man page, the “|” means: The items it separates can be used together The items it separates cannot be used together 18. The _____ command is normally executed daily to update the database of all files that are on the system. find locate search updatedb 19. The _____ command is normally executed to search for a command or man page. updatedb whereis find man -k 20. The _____ command can be used to find any file, not just commands or man pages. apropos whereis whatis locate 21. The info command merges all available documentation into a single “book”. True or False? True False 22. Section 9 of man pages relates to what? Library Calls Games Kernel Routines System Calls Miscellaneous 23. The man command searches each of the sections in order until it finds a match. True or False? True False 24. The whatis command will only return the first result for which section a man page is stored in. True or False? True False NDG Linux Essentials 2.0 Chapter 7 Exam Answers 1. Hidden files are files that begin with what character? A plus (+) An asterisk (*) A dash (-) A period (.) 2. What option for the ls command will display all files, including hidden files? -a -L -H -w 3. The top-level directory on a Linux system is represented as: /home C: /root / 4. Is the following path absolute or relative? /etc/ppp Absolute Relative 5. Is the following path absolute or relative? sysadmin/Documents Relative Absolute 6. Is the following path absolute or relative? ../../home/sysadmin Absolute Relative 7. The tilde (~) is used to represent: Any two single characters Nothing; it has no special meaning The directory above the current working directory A user’s home directory 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) cd && cd /home/bob cd ~bob ~bob 9. The double dot (..) can be used with the cd command to represent: A user’s home directory. Any two single characters Nothing; it has no special meaning. The directory above the current working directory 10. The cd command by itself will take you to what directory? None; it is not a valid command The system root directory Your home directory The directory above the current working directory 11. What command will allow you to change your current working directory? list chdir ls cd 12. The double dot (..) can be used to represent the directory… …below the current directory. …above the current directory. …with any two single numbers. …above the current directory only when using the cd command. 13. The ls command without options or arguments… …prompts for a directory to list. …generates an error as this command requires arguments. …lists the contents of a user’s home directory. …lists the contents of the current directory. 14. The first character in a long listing (ls -l) indicates: The permissions The owner If something is a file, directory, or symbolic link The size 15. Which option for the ls command, when used in conjunction with the - l option, will display human-readable file sizes? -S -H -h -M 16. Which of the following commands will prevent any aliased options to the ls command? %ls /ls `ls \ls 17. The ls command color codes results by default. True or False? True False 18. The command ls -S will sort files: By modification date, newest to oldest By size, largest to smallest By number of symlinks, largest to smallest By size, smallest to largest
NDG Linux Essentials 2.0 Chapter 8 Exam Answers
1. When using the cp command, you must provide both a source and a destination. True or False? True False 2. Which option(s) can be used to prevent cp from overwriting an existing file? (choose two) -z -n -N -i 3. The command rm -r will… remove a directory along with any files or subdirectories. generate an error; -r isn’t a valid option. remove only empty directories. prompt for each confirmation before deleting each file in a directory. 4. Which option can be used with the rm command to prompt before deleting? A -P l -i 5. The rm command can delete multiple files at once. True or False? True False 6. Which of the following commands can be used to rename a file? cp rm mv name 7. The touch command can be used to: (choose two) Update the timestamp of existing files Change ownership of a file Create new files Change a file’s name 8. Which of the following are glob characters? (choose three) The square brackets “[” and “]” The question mark “?” The dash character “-“ The asterisk “*” 9. The main purpose of using glob characters is to be able to provide a list of filenames to a command. True or False? True False 10. The asterisk character is used to represent zero or more of any character in a filename. True or False? True False 11. Which of these commands will return /etc/gai.conf /etc/pam.conf /etc/ucf.conf? (choose two) ls /etc/???.???? echo /etc/???.*f echo /etc/*?.*o? ls /etc/p???.** 12. Brackets cannot be used to a represent a range of characters. True or False? True False 13. Which command would list files that do not begin with a “T” or a “W”? echo /etc/*[TW!] echo /etc/!TW echo /etc/[!TW]* echo /etc/[*TW]! NDG Linux Essentials 2.0 Chapter 9 Exam Answers 1. Compression of a file works by: Eliminating gaps within the file Consolidating multiple files into one Removing redundant information Storing most of the data on removable media and just leaving a pointer Removing the high order bit from each byte 2. In general, for which of the following would you want to use lossless compression? An mp3 audio file An encrypted email A JPEG image A log file A movie 3. Lossy compression: (choose three) Usually results better compression than lossless Is often used with images Is often used with documents Decompresses to an identical version as the original Sacrifices some quality 4. You type gzip myfile.tar. What happens? (choose two) myfile.tar is unarchived into the current directory An error; you forgot to pass the name of the output file myfile.tar.gz holds a compressed version of myfile.tar An error; you forgot to specify the file with -f myfile.tar is removed 5. How would you obtain output similar to the following? 6. compressed uncompressed ratio uncompressed_name 7. 278168 1016950 72.6% tags gzip –l tags gunzip –t tags file tags 8. Which command would you use to archive the Documents directory and compress it with bzip2 compression? tar –fzc Documents documents.tbz tar –cf Documents documents.tbz tar –cjf Documents tar –cjf documents.tbz Documents tar –czf documents.tbz 9. Which flag would you pass to tar in order to have it make a new archive? -t -c -n -x -j 10. Which command will show what is inside the compressed tarball with a name of foo.tar.gz? tar –tjf foo.tar.gz tar –lf foo.tar.gz tar –tf foo.tar.gz tar –xf foo.tar.gz tar –tzf foo.tar.gz 11. In the command tar -cvjf foo.tbz a b c, what are a, b, and c? Nothing; -cvjf only expects one parameter File names to be added to the archive a is the directory that will be prepended to files; b and c are files inside it Matching operators; anything starting with a, b, or c will be added Extra flags passed to tar 12. Given the command tar –cvjf homedirs.tbz /home, which of the following are true? (choose two) Only files starting with /home will be extracted from the archive The command will print out each filename as it is processed The /home directory will be restored with the contents of homedirs.tbz Files that are present in the archive might overwrite files in /home The output file will be compressed 13. You archived your users’ directories into a file called backup.tar.gz. You then view the archive and see the filenames follow this convention: home/username/somefile How will you extract just the files for the user called fred? tar –xzf backup.tar.gz home/fred/ tar –tjf backup.tar.gz /home/fred tar –xjf backup.tar.gz home/fred/ tar –xzf backup.tar.gz fred tar –tzf /home/fred < backup.tar.gz 14. Which of the following commands will create a zipfile with the contents of your Documents directory? zip –f mydocs.zip Documents zip -r mydocs.zip Documents zip –c mydocs.zip Documents zip mydocs.zip Documents zip -cf mydocs.zip Documents 15. Given a file called documents.zip, how can you see what’s in it without extracting the files? zip -lf documents.zip unzip -l documents.zip unzip –list documents.zip zip -l documents.zip showzip documents.zip 16. Given a file called documents.zip, how can you extract just the files under ProjectX? unzip documents.zip ProjectX/* unzip documents.zip | grep ProjectX unzip documents.zip ProjectX zip -x documents.zip ProjectX unzip -t documents.zip ProjectX 17. You try to compress a file that is already compressed. Which of the following statements is true? The file will not be compressed any further than it already was The compression algorithm needs to be set to the “currently compressed” mode for it to be compressed further The file changed while you were compressing it The file will be deleted The file will actually be uncompressed 18. Which of the following commands can be used to compress a file? (choose three) bunzip2 cat zip bzip2 gzip 19. The three main modes of tar are: (choose three) List Create Compress Copy Extract 20. In the command tar -czf foo.tar.gz bar, what is the purpose of the f flag? Tells tar to copy only files, and not directories Tells tar to read from the file that follows the flag Tells tar to write to the file that follows the flag Tells tar to print the name of each file as it is processed Specifies extra compression is to be used 21. Which two commands do the same thing? (choose two) tar -czf foo.tar.gz foo tar -tzf foo.tar.gz tar -c foo | gzip > foo.tar.gz tar -x foo | gzip tar -xzf foo.tar.gz 22. Which two programs use the Lempel-Ziv-Markov chain algorithm? (choose two) xz lossless lossy bzip gzip 23. By default, the zip command replaces uncompressed files with compressed files. True or False? True False
NDG Linux Essentials 2.0 Chapter 10 Exam Answers
1. Error messages generated by commands are sent where by default? STDERR STDIN Log files STDOUT 2. A successful command may, or may not print output to STDOUT. True or False? True False 3. Which of the following commands will direct error messages to the file, error.log? ls /root >> error.log ls /root > error.log ls /root 2> error.log ls /root $> error.log 4. A pipe allows you to… …send the same input to multiple commands. …type multiple commands at one prompt. …send the output of one command to another. …send the output of a command to a file. 5. Channel 2 is: STDOUT STDALL STDERR STDIN 6. Which of the following commands will append its output to output.file? echo Testing >> output.file echo Testing > output.file output.file < echo Testing echo Testing -> output.file 7. Which command(s) can be used to sort the lines of list.file alphabetically and display it on the screen? (choose two) sort < list.file cat list.file >> sort echo list.file > sort cat list.file | sort 8. Which option of the head command will display only the first five lines of a file? No option needed; head displays only five lines by default. -n -l 5 -n 5 9. The grep command… …will display all the lines that begin with the specified Regular Expression. …will display all the lines in a file containing the specified Regular Expression. …will display the line numbers in a file that contain a specified Regular Expression. …is not case sensitive. 10. The grep command can be used with glob characters. True or False? True False 11. Which of the following commands will display only lines that begin with start? grep \start file.txt grep $start file.txt grep *start file.txt grep ^start file.txt 12. Which of the following commands will display only lines that begin with test? grep $test* file.txt grep *test file.txt grep &test file.txt grep ^test file.txt 13. Which of the following commands will display lines that contain either start or end? egrep ‘start|end’ file.txt egrep (start|end) file.txt egrep start end file.txt egrep start&end file.txt 14. Which of the following commands can be used to scroll through a text file? (choose two) some more cat less 15. Which option for the cut command is used to specify a delimiter? -D -f = -d 16. Which option for the cut command is used to specify the field? -d # -D -f 17. Which option for the wc command will print the number of lines in a file? -w -l -L -C 18. Which option for the wc command will print the total number of words in a file? -l -C -L -w 19. Which command can be used to print line numbers? num nl ln sort 20. The command echo "text" > file.txt will create file.txt if it does not already exist. True or False? True False 21. The command echo "text" > file.txt will not overwrite file.txt if it already exists. True or False? True False 22. The command echo "text" >> file.txt will not overwrite file.txt if it already exists. True or False? True False
NDG Linux Essentials 2.0 Chapter 11 Exam Answers
1. A file begins with #!/bin/csh. This means: This is a Perl script The operator should not be using /bin/csh C Shell compatibility mode is enabled Running the script will invoke /bin/csh to interpret the rest of the file Nothing, this is a comment 2. Which are appropriate editors for writing shell scripts? (choose two) Firefox /bin/bash LibreOffice Writer vi nano 3. Most of nano’s commands take the form of: Mouse clicks Escape followed by another character Control and another character The F1 through F12 function keys Alt and another character 4. What does this shell script do? 5. FOO=/tmp/foo
6. if [ ! –d $FOO ]; then
7. mkdir $FOO
fi
Creates /tmp/foo if it does not exist
Outputs a message to the screen Creates /tmp/foo and raises an error if there is a problem Nothing, since there is a problem with the conditions in the if statement Makes the /tmp/foo directory if a file by that name exists 8. Which of the following are correct about for and while loops? (choose two) for loops have a test each cycle to determine if it should run again for loops operate over a fixed list of items for loops require a variable over which to iterate while loops operate over a fixed list of items while loops have a test each cycle to determine if it should run again 9. Given the following part of a script: 10. if [ -f $1 ]; then
11. echo “I am here”
12. fi
What is the meaning of $1?
It is a parameter to -f, indicating the size of the file It is the first argument passed to the script It is a special variable that indicates the exit code of the command before it It is a file called $1 It is a list of files that gets interpolated 13. Given the following script that is run through ./test.sh hello goodbye: 14. if [ -f $2 ]; then
15. echo "I am here"
16. fi
When will “I am here” be printed?
If a file called “goodbye” exists in the current directory Never The script will always print “I am here” If there are two files in the current directory If a file called “hello” exists in the current directory 17. What is the correct way to assign the word “Hello” to a variable? A = “Hello” echo “Hello” > A echo $A “Hello” $A=”Hello” A=”Hello” 18. What is the correct way to save the current directory to a variable? A=`pwd` pwd | $A A=cwd A=pwd pwd $A 19. Which shell command accepts input from the user’s keyboard? echo read gets input $1 20. What information is held inside $? ? The name of the command run The previous command’s exit code The number of arguments passed to the script The current process id The current user ID 21. How would you finish your script with an exit code of 42? return 42 break 42 CODE=42 exit 42 $?=42 22. The if command looks for what exit code to consider a condition to be true? 1 0 2 10 255 23. The number of users logged in is in a variable called USERS. How would you test to see if 5 users are logged in? test $USERS –eq 5 test –f USERS=5 test $USERS = 5 test $USERS,5 test $USERS –a 5 24. Given the following script: 25. while [ ! –f /tmp/foo ]; do 26. echo –n “.”
27. process_data > /tmp/foo
28. done
Which of the following are true?
(choose two) The screen will fill with dots. If a file called /tmp/foo exists, process_data won’t be run process_data will be called at most once process_data will never be run /tmp/foo will be removed if it exists 29. A conditional that lets you make multiple comparisons with a pattern is called: fanout case if branch test 30. What is the meaning of $(( $i + 1)) ? 1 will be added to the i variable If i is 0, the loop will stop This will return the value of the next argument to the script This will return the value of the first argument to the script This runs the command stored in variable i 31. How would you write a test that says “if /tmp/foo is a directory or USERS is greater than 5”? test –d /tmp/foo –o $USERS –gt 5 test –d /tmp/foo | $USERS > 5 test /tmp/foo || $USERS > 5 test /tmp/foo –d –o $USERS -gt 5
NDG Linux Essentials 2.0 Chapter 12 Exam Answers
1. Which of the following are valid CPU types for Intel-based platforms? (choose two) 64-bit 32-bit 48-bit 24-bit 2. 64 bit platforms can access more memory than 32 bit platforms. True or False? True False 3. Choose all of the following statements that are true in regard to virtual RAM: (choose three) Virtual RAM is stored on a hard drive Virtual RAM is stored in the CPU Virtual RAM is used when available physical RAM is low. Virtual RAM is also called swap space 4. Which of the following are common busing systems? (choose two) CPU BIOS USB RAM PCI 5. A division of a hard drive may be referred to as a _______ . block partition portion label 6. Which of the following are valid partitioning types? (choose two) GPT PC MBR BIOS 7. The fdisk command is a tool used for working with the MBR partitioned disks. True or False? True False 8. Which of the following is the valid device file name for the first IDE hard drive on the system? /dev/ide /dev/hda /dev/sda /dev/hd1 9. Which of the following are valid video cable connector types? (choose two) HDA VGA AMD DVI 10. Which of the following commands will display CPU information? (choose two) lscpu cpuinfo lspic arch showcpu 11. What are the advantages of solid state disks when compared to traditional spinning platter hard disks? (choose two) Less heat Faster system boot times Higher capacity Low cost Low power consumption 12. Software that allows hardware devices to communicate with the installed operating system is called? Instructions Drivers Packages Programs 13. Which of the following commands will check hard disk MBR partitions? (choose three) fdisk gfdisk gdisk cfdisk sfdisk 14. Which of the following commands will check hard disk GPT partitions? (choose three) gdisk sgdisk sfdisk gfdisk cgdisk NDG Linux Essentials 2.0 Chapter 13 Exam Answers 1. When you execute the dmesg command, the system displays messages that are generated by the kernel. True or False? True False 2. The Linux kernel mounts the following pseudo-filesystems to provide access to information about hardware devices connected to the system: (choose two) /devices /proc /info /sys 3. The /proc directory contains a subdirectory for each process present on the system. True or False? True False 4. The Process ID (PID) of the init process is: 0 1 100 varies 5. The process (ps) command shows only processes running in the current shell by default. True or False? True False 6. The following system load averages are displayed by the top command: (choose three) 15 minute 1 minute 10 minute 5 minute 7. The free command outputs statistics about: CPU usage Software usage Memory usage Disk usage 8. What directory typically contains log files? /proc/loc /log /usr/log /var/log 9. Which log file contains messages regarding authentication and authorization? secure dmesg syslog messages 10. All log files contain only text data. True or False? True False 11. A load average of 1.0 always means the system is fully loaded. True or False? True False 12. A command that will continuously update statistics about running processes: tail head top Bottom 13. Which of the following is a valid Linux option style for Traditional Unix: two dashes (–) slash (/) no dash a single dash (-) 14. Which file contains the information passed to the kernel at boot time? /proc/kargs /proc/kopts /proc/cmdline /proc/kernel 15. To make changes permanent for kernel parameter files found under /proc/sys, the following file can have entries added to it: /etc/sysinfo.conf /etc/procctl.conf /etc/sysctl.conf /etc/procsys.conf 16. The /var directory has files that change over time. True or False? True False 17. Information about the init process can be found in the /proc/1 directory. True or False? True False 18. Which of the following commands will allow you to view all processes on the system? (choose two) ps -ef ps ps -A ps aux ps -eLf 19. The logging daemon on recent Linux distributions based on systemd is called: klogd journald rsyslogd syslogd 20. What does the acronym FHS stand for among the the standards supported by the Linux Foundation? Filesystem Hierarchy Standard File Hierarchy Standard Filesystem Hierarchy Structure 21. Which directory is the root of the filesystem? /sys /root / /home /var 22. The sbin directories are primarily intended to be used by the root user. True or False? True False
NDG Linux Essentials 2.0 Chapter 14 Exam Answers
1. Which of the following would be considered a host? A printer attached to the network via an IP address A network cable A CD-ROM The computer’s hard drive 2. A service is… …like an IP address. …a file that contains configuration information. …another name for a computer’s hostname. …a feature provided by one computer to another. 3. A network packet contains … (choose two) …the IP address of the source machine. …a hard drive partition. …the name of the router. …the IP address of the destination machine. 4. Only servers have hostnames. True or False? True False 5. Which of the following protocols defines how network communication functions? DHCP DNS TCP/IP SSH 6. Which of the following are valid IPv4 addresses? (choose two) 192.105.10.10.2 192.301.25.25 10.33.55.77 192.105.10.10 7. Which of the following commands will display the IP address on a Linux system? ifconfig dig route ipconfig 8. Which of the following commands will display the routing table? (choose two) dig netstat -r ifconfig route 9. Which of the following commands will allow you to log into a remote machine? dig netstat route ssh 10. What option to the netstat command has information shown as numbers rather than names? –name -r -t -n 11. Which of the following commands will allow you to log into the machine server1 with the account name nick? ssh nick&server1 ssh nick-server1 ssh nick@server1 ssh nick->server1 12. The RSA key fingerprint allows the dig command to connect to remote systems. True or False? True False 13. When looking at the primary IPv4 configuration file, if the device was configured to be a DHCP client, then the BOOTPROTO value would be set to none. True or False? True False 14. When issuing the service network restart command, which of the following occurs? …brings up all network interfaces, re-reads all related configuration files and then the networking for the system is restarted. …the networking for the system is stopped and then started back up. …takes down all network interfaces, re-reads all related configuration files and then the networking for the system is restarted. 15. Which of the following files contains the IP addresses of the name servers the system should consult in any attempt to resolve names to IP addresses? /etc/nsswitch.conf /etc/resolve.conf /etc/hosts /etc/resolv.conf 16. Which of the following commands can be used to display socket statistics, and supports all major packet and socket types? ss ifconfig route top
NDG Linux Essentials 2.0 Chapter 15 Exam Answers
1. Which files contain user account information? (choose two) /etc/shadow /etc/group /etc/passwords /etc/passwd 2. Which user can view the /etc/shadow file? Any member of the password group No users The root user All users 3. Which command will display the UID, GID and groups your current user belongs to? whoami Who id about 4. Each user belongs to at least one group. True or False? True False 5. Which command will display the users that are currently logged in to the system? about who id whoami 6. The sudo command allows regular users to… …execute commands as another user. …execute any command as root, after providing the root password. …run any command as root, after providing the sudo password. …run any commands as a system account without logging in. 7. Which of the following commands will display the group(s) a user belongs to? all id whoami group 8. Which of the following commands will display the groups that the user bob belongs to? group bob id bob groups -a all bob 9. The /etc/group file follows what structure? group:GID:user_list groups -a user:group group_name:password_placehoder:GID:user_list 10. A GID is associated with a group name. True or False? True False 11. A user can belong to… At least 16 groups Only five groups Only groups with a GID over 500 Only one group 12. Sudo privileges can be used to specify which user can use the sudo command to execute commands as other users. True or False? True False 13. 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? True False 14. Which of the following commands will display how long the system has been running since the last boot? (choose two) who id uptime w 15. The /etc/shadow file contains plain-text passwords. True or False? True False 16. Which command can be used to view the /etc/passwd file entries? uptime uppasswd getpasswd getent 17. All Linux systems allow administrators to log in as root. True or False? True False 18. What is the default user for the su command? All users The root user Any member of the password group The most recently created user 19. Which command would allow a user to execute commands as root? whoami about sudo who grep 20. File permissions cannot be edited by the root user. True or False? True False 21. Which command is used to display only the user’s primary group? who id -g man whoami about 22. Traditional UNIX systems allowed users to belong to how many groups? 10,000 1 65,000 256 16 23. What would an account with the UID 376 typically be used for? White hat hackers. Temporary employees. New users with full privileges. System service access. Root user access. 24. Usernames cannot be the same as group names. True or False? True False 25. To display the group(s) a user belongs to use this command: all id grep group whoami 26. Which command will display the groups that the root user belongs to? all -t groups -a id root all group -r 27. A value of 0 in the “minimum” password aging field means the user cannot change their password. True or False? True False 28. The “Epoch” began on January 1, 1970. True or False? True False 29. The last command displays reboot records… By default Never Only when issued by the root user After restarting the system When issued with the -p switch 30. Sudo privileges allow users to execute commands as another user. True or False? True False 31. When using the sudo command to execute a command as the root user, the command prompts for the user’s own password, not that of the root user. True or False? True False 32. The first line of this command displays how long the system has been running since being rebooted. su getent w id who 33. The /etc/shadow file contains encrypted passwords. True or False? True False 34. Which command can be used to view the /var/log/wtmp file entries? getent uptime getpasswd uppasswd last
NDG Linux Essentials 2.0 Chapter 16 Exam Answers
1. UIDs 1-499 are usually reserved for what kind of users? Remote log-in accounts Are not used for user accounts, but for group accounts System accounts, such as server processes Log-in (human) users 2. If a user is deleted, the files and directories that the user owned… …will have no user owner. …will have no UID owner. …will show a UID as the owner, but not user name. …are deleted as well. 3. Which of the following options for the useradd command allows root to specify the UID to be associated with the account? -g -G -u -M 4. Which of the following options for the useradd command allows root to specify supplementary groups the user will be a member of? -G -u -g -U 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? True False 6. 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? usermod -G extra bob usermod -ag bob extra usermod -aG extra bob usermod -a extra bob 7. Which option for the usermod command can be used to specify a user’s group ID (either primary or secondary)? (choose two) -s -g -S -G 8. For non-root users, the passwd command can only be used to change the password of the user running the command. True or False? True False 9. The groupmod command can be used to change a group name. True or False? True False 10. The groupmod command can be used to change a group GID. True or False? True False 11. The groupmod command can be used to add users to a group. True or False? True False 12. Which of the following commands can be used to modify a group? groupmod groupadd modgroup addgroup 13. Which command can be used to determine a user’s most recent log in? history last login shell 14. Which of the following files contains encrypted user password information? /etc/usr /etc/group /etc/passwd /etc/shadow 15. Which of the following files contains user IDs? /etc/group /etc/passwd /etc/usr /etc/shadow 16. Which of the following files does the groupadd command use to determine the new GID when a GID isn’t specified? /etc/usr /etc/shadow /etc/passwd /etc/group 17. Which of the following commands, run as root, will prevent the user bob from logging in? usermod -L bob usermod -l bob usermod -D bob usermod -d bob 18. What directory contains a user’s home directory? /user / /home /rootfs 19. GIDs under 500 (or 1000) are usually reserved for what kind of groups? System use Are not used for groups, but for user accounts Administrators User private groups (UPG) 20. If a user is deleted, the files and directories that the user owned… …are deleted as well. …will have no user owner. …may be important for others in the organization …will have no UID owner. 21. Which of the following options for the useradd command allows you to use a different primary group then the default? -g -G -U -u 22. On a system that uses UPG, the UID must not be the same as the GID.. True or False? True False 23. The usermod command can be used to unlock a users account with the following option. -s -u -f -U 24. Which of the following options for the useradd command allows you to use a different login shell than the default? -g -s -u -U 25. Which of the following commands will add the group extra to the user jane’s secondary groups in addition to jane‘s current secondary groups? usermod -a extra jane usermod -ag jane extra usermod -aG extra jane usermod -G extra jane 26. Which option for the usermod command can be used to specify a user’s primary group ID? -g -S -G -s 27. For root users, the passwd command can only be used to change the password of the user running the command. True or False? True False 28. The userdel -r command will… …will prompt before deleting each file owned by a user. …delete the user account, but leave the user’s files by default. …automatically delete a user and the user’s home directory and mail spool and their contents. …automatically delete a user and all the files owned by that user. 29. The groupmod command can be used to change a group name. True or False? True False 30. The groupmod command cannot be used to change a group GID. True or False? True Fasle 31. The groupdel command can be used to delete primary groups. True or False? True Fasle 32. Which of the following commands can be used to modify a user? adduser moduser useradd usermod 33. Which command can be used to determine a user’s most recent log in? history shell login last 34. The /etc/passwd file contains encrypted user password information. True or False? True or False? False True 35. Which of the following files contains group IDs? /etc/passwd /etc/usr /etc/shadow /etc/group 36. Which command allows you to view or change some of the default values used by the useradd command? useradd -D useradd -r modvalue useradd -f 37. Which of the following commands, run as root, will prevent the user jane from logging in? usermod -d jane usermod -D jane usermod -L jane usermod -l jane
NDG Linux Essentials 2.0 Chapter 17 Exam Answers
1. Which of the following commands set “other” permissions on file to r-x? chmod o-r-w file chmod o+rx file chmod o=rx file chmod o=r+x file 2. Which of the following commands sets “other” permissions on file to r-x? chmod 775 file chmod 776 file chmod 777 file chmod 774 file 3. Only one set (user, group, other) of permission can be changed at once using the symbolic method. True or False? True False 4. Which of the following are methods for setting permissions using the chmod command? (choose two) letter primary symbolic octal 5. The chown command can be used to change the owner and group of a file. True or False? True False 6. The user sysadmin will be able to read a file because they own it. True or False? True False 7. The user sysadmin will be able to change the permissions of a file because they own it. True or False? True False 8. Octal notation uses the following values for the permissions granted: r = 7, w = 5, x = 0 r = 3, w = 2, x = 1 r = 4, w = 2, x = 0 r = 4, w = 2, x = 1 9. Which of the following permissions would allow all users to add, view, and delete files in a directory? 750 775 666 777 10. A user cannot delete a file if they do not own it. True or False? True False 11. The “execute” permission on a directory allows you to: (choose three) Along with write permission to successfully delete the directory Along with read permission to successfully perform ls -l Along with write permission to successfully create new files Change to that directory or use it as part of a path 12. The “execute” permission on a file allows you to: Move the file to a new directory Delete the file Run the file as a script This permission isn’t meaningful for text files. 13. The chgrp command can be used on a file by: A user that belongs to the files current group Only the file owner The file owner and root Only root 14. The chown command can be used to change the user owner on a file by: The file owner Only root The file owner and root A user that belongs to the files current group 15. The chmod command can be used on a file by: Only root A user that belongs to the files current group The file owner The file owner and root 16. The “execute” permission is never set on files by default. True or False? True False 17. Which of the following chown commands will change the myFile user ownership to the user sam and the group ownership to administrators? (choose two) chown sam administrators myFile chown sam.administrators myFile chown sam:administrators myFile chown sam+administrators myFile 18. The chown command permits changing group ownership done by root only. True or False? True False 19. The user owner of a file will always have the same or higher permissions as “other”. True or False? True False 20. Which of the following commands will list hidden files as well as their ownership? ls -la ls -l ls -a ls -z NDG Linux Essentials 2.0 Chapter 18 Exam Answers 1. The /tmp directory is a temporary directory designed as a location where any user can create a temporary file. True or False? True False 2. The “sticky bit” permission… …sets the group ownership of any new file created in a directory. …prevents others from removing files they don’t own from a common directory. …changes the group ownership of existing files in a directory. …prevents others from overwriting files they don’t own in common directories. 3. Which of the following commands will set the “sticky bit” on /shared ? chmod 2777 /shared chmod 1777 /shared chmod 6777 /shared chmod 4777 /shared 4. The “setuid” permission… …prevents the owner of a file from being changed. …allows files in a directory to be manipulated as by the directory owner. …reports the output of a script to the owner. …allows a command to be run as the file owner. 5. Which of the following commands will set setuid for /usr/bin/program? chmod 4755 /usr/bin/program chmod 2755 /usr/bin/program None of the above chmod 1755 /usr/bin/program 6. The “setgid” permission… (choose two) …prevents the group owner of a file from being changed. …allows a command to be run as the group owner of the file. …allows files created in a directory to be owned by the group that owns the directory. …can only be set on files. 7. Which of the following commands will set setgid on /shared ? None of the above chmod 2777 /shared chmod 1777 /shared chmod 4777 /shared chmod 4777 /shared 8. Which of the following long listings represents setgid set for /shared ? drwxrwsrwx. 12 root group 4096 Oct 21 13:12 /shared drwsrwxrwx. 12 root group 4096 Oct 21 13:12 /shared drwxrwxrws. 12 root group 4096 Oct 21 13:12 /shared drwSrwxrwx. 12 root group 4096 Oct 21 13:12 /shared 9. Setting setgid on a directory… …will allow scripts in the directory to be executed as the group owner of the directory. …is not allowed by the system. …does nothing. …will set the group owner of all files created in the directory to the group owner of the directory. 10. Deleting a source file will break an associated hard link. True or False? True False 11. A source and a hard link must be part of the same filesystem. True or False? True False 12. Deleting a source file will break an associated symbolic link. True or False? True False 13. A source file and a symbolic link must be part of the same file system. True or False? True False 14. Which of the following commands would create a hard link, link to file? ln file link ln link file ln -s file link ln -s link file 15. Which of the following commands would create a symbolic link, link to file? ln file link ln -s link file ln link file ln -s file link 16. Which of the following ls commands, when executed, will only show information about the directory itself? (choose two) ls -h ld -d ls -ld ld -a 17. Which of the following directories are designed as locations where any user can create a temporary file? (choose two) /sbin /lost+found /tmp /home /var/tmp NDG Linux Essentials 2.0 Midterm Exam (Chapter 1-9) Answers 1. The most popular Linux platform for mobile phones is: Android Slackware BlackBerry IOS MobileLinux 2. The release cycle: Only has meaning for paid software Describes how long software will be supported Should be long so that you have time before you need to upgrade Should be short so you always have the freshest releases Dictates how often software is updated 3. What does a distribution provide to add and remove software from the system? Package Manager Application Programming Interface (API) Partitioning tool Compiler Bash 4. A maintenance cycle: Describes how often updates for software come out Should be short so you always have the freshest releases Describes how long a version of software will be supported Only has meaning for paid software Should be long so that you have time before you need to upgrade 5. When choosing a distribution of Linux, you should consider: (choose five) Popularity on social media Does the distribution offer a “stable” version Does your organization require long-term support for the system If the application software is supported by the distribution Will users require a GUI Will commercial support be required for the OS 6. Which of the following are examples of desktop software? (choose two) File share Compiler Music player Web server Web browser 7. Which of the following pieces of software deal with file sharing? (choose three) Netatalk Samba X-Windows NFS PostgreSQL 8. The Linux shell: (choose three) Is responsible for tracking the location of configuration files Has a scripting language Has a built-in text editor Is customizable Allows you to launch programs 9. Virtualization means: Many users can share one hard drive A user can connect to a server over the network and use a virtual console A machine can swap memory to disk A single host can be split up into multiple guests Two users get different memory spaces on the same machine 10. In graphical mode, you can get to a shell by running which applications? (choose two) Gbash Guiterm Terminal Xterm console 11. Source code refers to: A human-readable version of computer software The interface that software uses to talk to the kernel The version of a program that the computer runs on the CPU The license that dictates how you may use and share the software 12. Open source means: (choose two) You can modify the software’s source code You must share your changes You must support the software you share You cannot charge anything for the software You can view the software’s source code 13. A copyleft provision in a software license means: You give up your copyright to the software You may not link against third party closed source software You must provide support for your modifications You must provide free copies of the software if you use it If you redistribute the software, you must distribute the source to any changes you make 14. Linux is distributed under which license? MIT GPLv2 GPLv3 Linux Foundation BSD 15. Creative Commons licenses allow you to: (choose three) Receive royalties on the use of the work Allow or disallow commercial use Specify whether or not people may distribute changes Get a veto on where the work is used Specify whether or not changes must be shared 16. Which environment variable contains a list of directories that is searched for commands to execute? PS2 PATH EXEC PS1 17. Select the command that can report the location of a command: what where which 18. A pair of double quotes (" ) will prevent the shell from interpreting any metacharacter. True or False? True False 19. The shell program interprets the commands you type into the terminal into instructions that the Linux operating system can execute. True or False? True False 20. The acronym CLI stands for: Command Line Interface Computer Link Interpreter Command Line Interpreter Computer Line Interface 21. The most common shell used for Linux distributions is the ________ shell. Zsh Fish Tsch Bash 22. Which two pager commands are used by the man command to control movement within the document? (choose two) more page grep less 23. To search the man page sections for the keyword example, which of the following command lines could you execute? (choose two) man -k example apropos example man -f example whatis example 24. The statement that describes the difference between a man page and an info page is: The man page is a long detailed reference; the info page is very terse. There is very little difference between them. The man page is like a guide; the info page is a more concise reference. The info page is like a guide; a man page is a more concise reference. 25. The following sections commonly appear on a man page: (choose three) SYNOPSIS NAME LICENSE DESCRIPTION 26. The top-level directory on a Linux system is represented as: / /home C: /root 27. The tilde (~) is used to represent: Nothing; it has no special meaning Any two single characters The directory above the current working directory A user’s home directory 28. The cd command by itself will take you to what directory? The directory above the current working directory None; it is not a valid command Your home directory The system root directory 29. What command will allow you to change your current working directory? ls list chdir cd 30. The first character in a long listing (ls -l) indicates: If something is a file, directory, or symbolic link The size The permissions The owner 31. Which of the following commands can be used to rename a file? rm cp name mv 32. The touch command can be used to: (choose two) Change ownership of a file Create new files Change a file’s name Update the timestamp of existing files 33. Which of the following are glob characters? (choose three) The question mark “?” The dash character “-“ The square brackets “[” and “]” The asterisk “*” 34. The main purpose of using glob characters is to be able to provide a list of filenames to a command. True or False? True False 35. The asterisk character is used to represent zero or more of any character in a filename. True or False? True False 36. Compression of a file works by: Removing the high order bit from each byte Eliminating gaps within the file Storing most of the data on removable media and just leaving a pointer Removing redundant information Consolidating multiple files into one 37. Lossy compression: (choose three) Usually results better compression than lossless Is often used with images Sacrifices some quality Is often used with documents Decompresses to an identical version as the original 38. Which of the following commands can be used to compress a file? (choose three) zip bzip2 gzip bunzip2 cat 39. The three main modes of tar are: (choose three) Copy List Compress Extract Create 40. In the command tar -czf foo.tar.gz bar, what is the purpose of the f flag? Tells tar to write to the file that follows the flag Tells tar to print the name of each file as it is processed Tells tar to read from the file that follows the flag Specifies extra compression is to be used Tells tar to copy only files, and not directories
NDG Linux Essentials 2.0 Final Exam (Chapter 9-18) Answers
1. Which of the following are traits of a multiuser operating system? (choose three) Resources are shared between users Users can protect their information from other users Many users can log in simultaneously with a unique account Each user can only log in once per day An administrative user gets a dedicated CPU 2. A pipe allows you to… …send the same input to multiple commands. …type multiple commands at one prompt. …send the output of one command to another. …send the output of a command to a file. 3. Channel 2 is: STDALL STDOUT STDERR STDIN 4. The grep command… …will display all the lines that begin with the specified Regular Expression. …will display all the lines in a file containing the specified Regular Expression. …is not case sensitive. …will display the line numbers in a file that contain a specified Regular Expression. 5. Which of the following commands can be used to scroll through a text file? (choose two) cat less some more 6. Which command can be used to print line numbers? ln nl sort num 7. Which are appropriate editors for writing shell scripts? (choose two) LibreOffice Writer vi Firefox nano /bin/bash 8. Which of the following are correct about for and while loops? (choose two) while loops operate over a fixed list of items for loops have a test each cycle to determine if it should run again while loops have a test each cycle to determine if it should run again for loops operate over a fixed list of items for loops require a variable over which to iterate 9. What is the correct way to assign the word “Hello” to a variable? $A=”Hello” A = “Hello” echo “Hello” > A A=”Hello” echo $A “Hello” 10. What is the correct way to save the current directory to a variable? pwd $A A=cwd A=`pwd` A=pwd pwd | $A 11. What is the meaning of $(( $i + 1)) ? If i is 0, the loop will stop This runs the command stored in variable i This will return the value of the next argument to the script 1 will be added to the i variable This will return the value of the first argument to the script 12. Which of the following are valid CPU types for Intel-based platforms? (choose two) 64-bit 24-bit 32-bit 48-bit 13. Choose all of the following statements that are true in regard to virtual RAM: (choose three) Virtual RAM is stored in the CPU Virtual RAM is also called swap space Virtual RAM is stored on a hard drive Virtual RAM is used when available physical RAM is low. 14. A division of a hard drive may be referred to as a _______ . label block portion partition 15. The fdisk command is a tool used for working with the MBR partitioned disks. True or False? True False 16. Which of the following commands will display CPU information? (choose two) cpuinfo lscpu showcpu lspic arch 17. The Process ID (PID) of the init process is: 100 0 1 varies 18. What directory typically contains log files? /proc/loc /usr/log /log /var/log 19. The /var directory has files that change over time. True or False? True False 20. Which of the following commands will allow you to view all processes on the system? (choose two) ps -ef ps aux ps -eLf ps -A ps 21. Which directory is the root of the filesystem? /sys / /var /home /root 22. A service is… …another name for a computer’s hostname. …a file that contains configuration information. …like an IP address. …a feature provided by one computer to another. 23. Only servers have hostnames. True or False? True False 24. Which of the following are valid IPv4 addresses? (choose two) 10.33.55.77 192.105.10.10.2 192.105.10.10 192.301.25.25 25. Which of the following commands will allow you to log into a remote machine? route ssh dig netstat 26. Which files contain user account information? (choose two) /etc/passwd /etc/passwords /etc/shadow /etc/group 27. Which command will display the UID, GID and groups your current user belongs to? whoami Who about id 28. Each user belongs to at least one group. True or False? True False 29. Which command will display the users that are currently logged in to the system? id who about whoami 30. Which command will display the groups that the root user belongs to? all all -t group -r id root groups -a 31. UIDs 1-499 are usually reserved for what kind of users? Are not used for user accounts, but for group accounts Log-in (human) users Remote log-in accounts System accounts, such as server processes 32. Which of the following options for the useradd command allows root to specify the UID to be associated with the account? -u -g -M -G 33. Which command can be used to determine a user’s most recent log in? last login history shell 34. Which of the following files contains encrypted user password information? /etc/shadow /etc/group /etc/usr /etc/passwd 35. Which of the following options for the useradd command allows you to use a different primary group then the default? -G -u -U -g 36. Which of the following commands can be used to modify a user? adduser usermod moduser useradd 37. Which of the following are methods for setting permissions using the chmod command? (choose two) letter primary symbolic octal 38. The chown command can be used to change the owner and group of a file. True or False? True False 39. The chmod command can be used on a file by: The file owner and root The file owner Only root A user that belongs to the files current group 40. The “execute” permission is never set on files by default. True or False? True False 41. The “sticky bit” permission… …changes the group ownership of existing files in a directory. …prevents others from removing files they don’t own from a common directory. …sets the group ownership of any new file created in a directory. …prevents others from overwriting files they don’t own in common directories. 42. The “setuid” permission… …prevents the owner of a file from being changed. …reports the output of a script to the owner. …allows a command to be run as the file owner. …allows files in a directory to be manipulated as by the directory owner. 43. The “setgid” permission… (choose two) …prevents the group owner of a file from being changed. …allows files created in a directory to be owned by the group that owns the directory. …allows a command to be run as the group owner of the file. …can only be set on files. 44. Which of the following ls commands, when executed, will only show information about the directory itself? (choose two) ls -h ld -d ld -a ls -ld NDG Linux Essentials 2.0 Final Comprehensive Exam (Chapter 1-18) Answers 1. Embedded Systems means: Companies must share their changes You can view the software’s source code Businesses cannot charge anything for the software, only the hardware Systems designed to do a specific task on hardware optimized for only that purpose Users must support the systems themselves 2. Linux originally only ran on: Xerox copy machines Specialized processor chips Intel 386 PCs Raspberry Pi computers Macintosh 3. Bundling utilities, management tools, and application software with a Linux kernel is called a: A trademark A distribution of Linux A type of hardware A text editor 4. A software release cycle describes: How often security fixes are implemented How often the software’s memory is released back to the operating system How often upgrades come out for software How often the computer must be rebooted How often the computer must be upgraded to support new software 5. Apple’s OS X is: (choose three) A fully certified UNIX distribution Tightly integrated with Apple hardware Partially based on code from the FreeBSD project Primarily used to manage network services Derived from Linux Able to natively run Windows binaries 6. Microsoft Windows: (choose three) Is generally backwards compatible with previous versions Offers both desktop and server products Has a Linux compatibility mode Has a short maintenance cycle Has a scripting environment called PowerShell Has a new desktop version every year. 7. An interpreted programming language: (choose two) Requires a compilation step but no linking step Is converted into machine specific instructions as the program runs Tends to offer more features than compiled languages Requires a linking step but no compilation step Takes fewer resources to run than a compiled language 8. The two main families of Linux shells are: (choose two) Bourne Shell Python Shell Korn shell Emacs C Shell 9. In virtualization, what are the host and guest? (choose two) The host is the machine that runs the virtual machines The guest is the machine that runs the virtual machines The terms can be used interchangeably A host is a virtual machine A guest is a virtual machine 10. Cloud computing is: Requires fewer resources because systems are shared among many users Allows users in different geographical regions to work together in real time All are correct Is made possible by faster internet speeds Is useful for both business and home users 11. Which of the following are properties of a strong password? (choose three) Based on easy to remember items like birthdays Long so that it can be reused on multiple sites Includes symbols At least 10 characters long A mix of upper and lower case 12. A license where you don’t have access to the source code is called: Sourceless Impaired source Open source Closed source 13. A copyleft provision in a software license means: You must provide support for your modifications You may not link against third party closed source software If you redistribute the software, you must distribute the source to any changes you make You must provide free copies of the software if you use it You give up your copyright to the software 14. The Free Software Foundation believes that: (choose two) Software should be free to modify People should write software with no expectation of making money Software should not have copyright Software should be free to share No money should ever change hands 15. What does it mean when a work is placed in the public domain? The work was done by a government agency You may not use the work for commercial purposes The author has died The author has relinquished the copyright on the work You must redistribute changes to the software 16. The semicolon (;) can be used to separate multiple commands to be executed in order. True or False? True False 17. To be able to output messages to the screen, use the _______ command: print echo display type 18. The _______ command will print a list of the commands that you’ve previously executed. list eval exec history 19. HOME is an example of _________. A path variable A local variable An environment variable An alias An internal command 20. The directory where additional documentation for software packages most likely can be found is: /var/share/doc /var/lib/doc /usr/software/doc /usr/share/doc 21. To start searching a man page, the first key you press is: / f s ! 22. To get help on using the info command, execute: (choose two) man info info info help info info -q 23. The _____ command can be used to find any file, not just commands or man pages. whatis locate whereis apropos 24. Hidden files are files that begin with what character? A period (.) An asterisk (*) A plus (+) A dash (-) 25. The top-level directory on a Linux system is represented as: / /home /root C: 26. The ls command without options or arguments… …prompts for a directory to list. …lists the contents of the current directory. …lists the contents of a user’s home directory. …generates an error as this command requires arguments. 27. The command ls -S will sort files: By size, smallest to largest By modification date, newest to oldest By number of symlinks, largest to smallest By size, largest to smallest 28. When using the cp command, you must provide both a source and a destination. True or False? True False 29. Which option can be used with the rm command to prompt before deleting? l A -P -i 30. Which command would list files that do not begin with a “T” or a “W”? echo /etc/[!TW]* echo /etc/[*TW]! echo /etc/!TW echo /etc/*[TW!] 31. In general, for which of the following would you want to use lossless compression? A JPEG image A log file An encrypted email A movie An mp3 audio file 32. You type gzip myfile.tar. What happens? (choose two) An error; you forgot to specify the file with -f myfile.tar is unarchived into the current directory myfile.tar is removed An error; you forgot to pass the name of the output file myfile.tar.gz holds a compressed version of myfile.tar 33. Which command will show what is inside the compressed tarball with a name of foo.tar.gz? tar –tf foo.tar.gz tar –tzf foo.tar.gz tar –xf foo.tar.gz tar –lf foo.tar.gz tar –tjf foo.tar.gz 34. By default, the zip command replaces uncompressed files with compressed files. True or False? True False 35. Error messages generated by commands are sent where by default? STDIN Log files STDOUT STDERR 36. Which of the following commands will display only lines that begin with test? grep *test file.txt grep &test file.txt grep $test* file.txt grep ^test file.txt 37. Which of the following commands will display lines that contain either start or end? egrep ‘start|end’ file.txt egrep start end file.txt egrep start&end file.txt egrep (start|end) file.txt 38. A file begins with #!/bin/csh. This means: This is a Perl script The operator should not be using /bin/csh C Shell compatibility mode is enabled Running the script will invoke /bin/csh to interpret the rest of the file Nothing, this is a comment 39. Most of nano’s commands take the form of: Alt and another character Escape followed by another character The F1 through F12 function keys Mouse clicks Control and another character 40. The if command looks for what exit code to consider a condition to be true? 255 0 2 1 10 41. The number of users logged in is in a variable called USERS. How would you test to see if 5 users are logged in? test $USERS –eq 5 test $USERS,5 test –f USERS=5 test $USERS = 5 test $USERS –a 5 42. Which of the following are valid partitioning types? (choose two) PC MBR GPT BIOS 43. Software that allows hardware devices to communicate with the installed operating system is called? Drivers Instructions Packages Programs 44. Which of the following commands will check hard disk GPT partitions? (choose three) sfdisk sgdisk gdisk cgdisk gfdisk 45. The process (ps) command shows only processes running in the current shell by default. True or False? True False 46. The free command outputs statistics about: Memory usage Disk usage Software usage CPU usage 47. Which file contains the information passed to the kernel at boot time? /proc/kernel /proc/kopts /proc/kargs /proc/cmdline 48. To make changes permanent for kernel parameter files found under /proc/sys, the following file can have entries added to it: /etc/sysinfo.conf /etc/sysctl.conf /etc/procctl.conf /etc/procsys.conf 49. Which of the following commands will display the IP address on a Linux system? ifconfig route ipconfig dig 50. The RSA key fingerprint allows the dig command to connect to remote systems. True or False? True False 51. When issuing the service network restart command, which of the following occurs? …takes down all network interfaces, re-reads all related configuration files and then the networking for the system is restarted. …the networking for the system is stopped and then started back up. …brings up all network interfaces, re-reads all related configuration files and then the networking for the system is restarted. 52. Which of the following commands can be used to display socket statistics, and supports all major packet and socket types? route ss ifconfig top 53. Which of the following commands will display the groups that the user bob belongs to? group bob id bob all bob groups -a 54. Traditional UNIX systems allowed users to belong to how many groups? 65,000 10,000 1 256 16 55. A value of 0 in the “minimum” password aging field means the user cannot change their password. True or False? True False 56. Sudo privileges allow users to execute commands as another user. True or False? True False 57. The first line of this command displays how long the system has been running since being rebooted. id getent who w su 58. Which option for the usermod command can be used to specify a user’s group ID (either primary or secondary)? (choose two) -g -S -s -G 59. The groupmod command can be used to add users to a group. True or False? True False 60. Which of the following files contains user IDs? /etc/passwd /etc/shadow /etc/group /etc/usr 61. Which of the following commands, run as root, will prevent the user bob from logging in? usermod -L bob usermod -D bob usermod -d bob usermod -l bob 62. What directory contains a user’s home directory? /rootfs /user / /home 63. GIDs under 500 (or 1000) are usually reserved for what kind of groups? Are not used for groups, but for user accounts Administrators User private groups (UPG) System use 64. A user cannot delete a file if they do not own it. True or False? True False 65. The chown command permits changing group ownership done by root only. True or False? True False 66. Which of the following commands will list hidden files as well as their ownership? ls -a ls -z ls -l ls -la 67. Which of the following commands will set setuid for /usr/bin/program? chmod 1755 /usr/bin/program chmod 4755 /usr/bin/program chmod 2755 /usr/bin/program None of the above 68. Setting setgid on a directory… …will allow scripts in the directory to be executed as the group owner of the directory. …will set the group owner of all files created in the directory to the group owner of the directory. …is not allowed by the system. …does nothing. 69. Deleting a source file will break an associated hard link. True or False? True False 70. Which of the following commands would create a hard link, link to file? ln file link ln -s link file ln link file ln -s file link