final linux exam
What FTP command runs a shell on the local computer?
!
Which of the following characters can be entered at the beginning of a line in a shell script to ensure that line is recognized as a comment rather than try to execute it?
#
Your home directory has a two subdirectories: called mydir1 and mydir2 . The mydir1 directory contains a file called myfile . Assume your current working directory is the mydir1 directory. Using a relative path, enter the shortest command to move myfile from the mydir1 directory to the mydir2 directory.
(mv myfile ../mydir2)
Which of the following options for the gpg command will specify the key that should be retrieved?
--recv-keys
Which of the following options for the gpg command will attempt to use the gpg agent and if it cannot will ask for a passphrase?
--use-agent
Which of the following options for the iptables command will delete all rules for all chains?
-F
What option can be added to the dpkg command to remove a specified package from the system, including any configuration files used by the package?
-P
Which of the following RPM options will update a software package to the newest version, or install the package if it does not already exist on a system?
-U
Which listing option returns all files (including hidden files).
-a
What symbol is used to represent the current working directory?
.
Which of the following are considered a relative path.
. ..
What symbol is used to represent the parent directory of current working directory?
..
Which of the following files can you add filenames to so that the git add * command will not stage them?
.gitignore
Which of the following is not a valid compression file extension for the Linux operating system?Group of answer choices
.vz
Linux is considered a UNIX-like operating system.
/ ~ /home
Which of the following is the full path and file name where the Debian Package Manager repositories can be configured?
/etc/apt/sources.list
On a system running SysV init, which of the following files can you edit to disable the ability to reboot by using the Ctrl+Alt+Delete key combination?
/etc/inittab
Which of the following files is where the default runlevel is set on some Linux systems?
/etc/inittab
Which of the following files contains the list of shared libraries?
/etc/ld.so.cache
Which of the following files contain the path and filename where DNS servers should be configured?
/etc/resolv.conf
In which file can you configure rules for logging on a Linux system?
/etc/rsyslog/conf
In which of the following directories can you place files that will be copied to new user directories when new users are created?
/etc/skel
Where does the sudo command check to determine a user's privileges when they attempt to run the sudo command?
/etc/sudoers
This directory contains all user's home directories.
/home
Which of the following files stores information about failed logins on a Linux system?
/var/log/btmp
What zone configuration file contains a PTR record used to identify the loopback adapter?
/var/named/named.local
Where is the default document root directory for the Apache Web server?
/var/www/html
Which of the following would be the results of running the command seq 7?
1 through 7 being displayed one number per line.
Which of the following can you use to start network daemons in order to limit which computers are allowed to connect to the network service?
TCP Wrapper
When looking at the password-auth file on a Fedora system, you notice part of the syntax that says dcredit=3. What is the significance of this part of the configuration?
Users must use at least 3 characters as numbers in their passwords.
Which of the following is a tool that can be used to search Internet software repositories for RPM packages that map to your system's architecture, and automatically install or upgrade those packages on your system?Group of answer choices
YUM
Which type of CM software can connect to inventory members via SSH to perform configuration management activities?
agentless
Which of the following commands can you use to search available repository information? (Choose two.)
apt apt-cache
Which of the following commands can be used to install the latest versions of all packages currently installed on the system from the sources configured in sources.list?
apt upgrade
Which of the following Debian Package Management commands will install the newest versions of all packages that are currently installed on a system?
apt-get upgrade
Which of the following results would be created by the command sequence: echo 'apple banana carrot dog elephant' | while read a b c; do echo result: $c $b $a; done
carrot dog elephant banana apple
These commands output the contents of a file on a page-by-page basis.
cat more less cut sort touch head wc tail tee
Assume you are in the /user directory. The /user directory contains the rings.txt file. Enter the command to output the contents of the rings.txt file.
cat rings.txt
What is the shortest command a user can enter to return to their home directory?
cd
This command changes directories to the current working directory's parent directory.
cd ..
What is the root directory's path (i.e., what is the root directory's symbol)?
cd /
Which of the following will show account aging information for a user such as the date of the last password change, when the password expires, and the number of days of warning before the password expires?
chage -l jsmith
Your home directory has a file called myfile . Assume your present working directory is your home directory. Using the octal permissions method, change myfile to have the following permissions: For user: read, write, and execute For group and other: read and execute
chmod 755 myfile
Which of the following is used on modern Linux distributions that reads YAML configuration files to add apps, modify existing configuration settings, or perform administrative tasks at boot time?
cloud-init
Assume your present working directory is your home directory. A file called myfile1 is in your home directory. Create a copy of myfile1 and place the copy in the same directory (i.e., your home directory). Call the copied file myfile2 . Enter the shortest command to accomplish this task.
cp myfile1 myfile2
Assume your present working directory is your home directory. Create a copy of the file /etc/helloworld.py and place the copy (with the same name) in your present working directory. Enter the shortest command to accomplish this task.
cp/etc/helloworld.py
Which of the following commands can be used to back up files in case of system failure, supports long filenames, and can also back up device files?
cpio
This command outputs, by default, the last 10 lines of a specified file.
cut sort tee tail cat head touch more wc less
Which of the following file extensions are used by the Debian Package Manager?
deb
Which of the following types of CM software only requires that you specify the attributes that the inventory members must have within a configuration file, not the individual procedures that must be executed on them?
declarative configuration
Which of the following commands will list the BIOS information about a device when it cannot otherwise be detected by a Linux system?
dmidecode
Which of the following commands can be used to modify configuration options for DPM packages after they have been installed?
dpkg-reconfigure
Which of the following is the log file where the Debian Package Manager writes entries for actions taken and packages installed?
dpkg.log
You have just created a variable named CREATOR. Which of the following commands will display the contents of the variable to standard output?
echo $CREATOR
Which of the following commands can be used to view the quota for a user?
edquota -u jsmith
Enter the keyboard character (and only the keyboard character) used to switch vi from Command Mode to Insert Mode. Answer:
i,l
Which of the following types of joins will return a record from two intersecting tables only if there is a match on the joining field from both tables?
inner join
Which of the following can you use to configure firewall rules for IPv6 on a Linux system?
ip6tables
Which of the following log files contains information and error messages generated by the Linux kernel?
kern.log
Which of the following will invalid entries in the GRUB2 configuration cause?
kernel panic and halt the system
Which of the following commands will list missing libraries as not found if a necessary library is not installed?
ldd
This command displays a listing of files and directories in the current working directory. (Do not include any options in your response.) Answer
ls
Which of the following commands can be used to display any email messages awaiting delivery alongside the reason that they were not delivered?
mailq
What command looks for a Makefile and uses the information within it to compile the source code into binary programs using the appropriate compiler program for the local hardware architecture?
make
After compiling source code, which command still needs to be run in order to copy the newly compiled binaries into a directory listed in the PATH variable as well as copy supporting files (such as man pages) to the correct location on the filesystem?
make install
Enter the command to open the manual pages for the change directory command.
man cd
Assume your present working directory is your home directory. Enter the shortest command to create a directory called mydir in the current working directory.
mkdir mydir
The subdirectory newdir does not currently exist in the current directory that you are in. Which of the following commands will create a new directory named newdir and then change into that directory? (Choose two.)
mkdir newdir && cd newdir mkdir newdir; cd newdir
What ftp command uploads the filename from the current directory on the local computer to the current directory on the remote computer and allows the use of wildcard metacharacters to specify the filename?
mput filename
Which of the following is a lightweight desktop environment that uses very few system resources that a system administrator might choose to install on a Linux server instead of one of the two main desktop environments?
xfce
What command can be used to display the contents of a file that was compressed with the compress utility?Group of answer choices
zcat
What symbol is used to represent the current user's home directory?
~
What DNS resource record type is used to provide the IP address for the e-mail server for a zone?
mx or MX
After modifying the /etc/aliases file, what command must be run in order to rebuild the aliases database?
newaliases
Which of the following commands will display the output of a file while also displaying a line number at the left side of each line for the /etc/passwd file?
nl /etc/passwd
A directory has the following permissions: drwx------ What permissions does "group" have?
none
Which of the following permissions should a standard user have on the /etc/shadow file?
none of the above
What PostgreSQL command-line utility backs up PostgreSQL database settings?
pg_dump
Which of the following commands can be used to determine the round trip time that a packet takes to traverse a network connection?
ping
Enter the command to immediately power-down a Linux computer Answer:
poweroff
What is the command used to identify the current working directory?
pwd
A directory has the following permissions: dr--r-xr-x What permissions does "user" have?
read
Which of the following can be included in a shell script to ask the user to type in a password and then store it in the variable named $password?
read -s -p "Please enter the password: " password
A directory has the following permissions: drwxr-xr-- What permissions does "group" have?
read write
A directory has the following permissions: drwxrwxrwx What permissions does "other" have?
read write execute
Enter the command restart a Linux computer.
reboot
Which of the following commands will install an RPM package while ignoring any other packages that it may be dependent upon for proper operation?
rpm -ivh --nodeps package.rpm
Which of the following commands will install a package using the Red Hat Package Manager, showing all information, while printing pound signs to show the progress of installation?
rpm -ivh packagename.rpm
Which of the following commands will show the current runlevel along with the previous runlevel? (Choose all that apply.)
runlevel echo $RUNLEVEL
Which of the following commands will count down from 10 to 1?
seq 10-1 1
Which of the following hashing algorithm commands reduces the chances of collisions due to the bit length of the message digest?
sha256sum
Which of the following commands will display the contents of the /etc/passwd file in alphanumerical order?
sort /etc/passwd
Which of the following is a valid method of running a script named myscript.sh? (Choose two)
source myscript.sh /myscript.sh
Which of the following commands will allow the root user to switch to another user account without having to enter that user account's password?
sudo
While Linux is not the same as UNIX, Linux does borrow heavily from UNIX.
true
An alias has previously been created named showauth. Which of the following commands can be used to get rid of that alias?
unalias showauth
Which of the following is responsible for starting tasks and services during boot, stopping them during shutdown, and supervising them while the system is running?
upstart
Which of the following commands can be used to delete a user account?
userdel
Which of the following commands can be used to set the number of days until user account jsmith with an expired password is disabled?
usermod -f 15 jsmith
Assume you are in the /user directory. The /user directory contains the rings.txt file. Enter the command to open the rings.txt file in the vi text editor.
vi rings.txt
Which of the following commands will allow an administrator to edit the list of permissions assigned to a user wanting to run the sudo command?
visudo
Which of the following can be used at the command line to download a file using the HTTP protocol? (Choose two.)
wget curl
Which of the following results from the nmap command would let an administrator know that they have an insecure service running on a Linux server?
23/tcp open telnet
If no level of compression is specified, the gzip command assumes what compression level?Group of answer choices
6
Which of the following can be used for comparing values within an if statement? (Choose two.)
= -lt
What is the most popular (and typically default) Linux command-line shell?
BASH (Bourne-Again Shell)
Which of the following is the default desktop environment used by Linux Mint?
Cinnamon
Which of the following SQL statements can be used to delete a table from a database?
DELETE TABLE table_name;
In which of the following zones might a system administrator put the web server hosting the company's publicly accessible website?
DMZ
What kind of servers resolve fully qualified domain names to IP addresses for a certain namespace on the Internet?
DNS
Which of the following statements should be used at the end of a SQL statement where an aggregate function such as SUM or COUNT is used?
GROUP BY
When working with Sendmail, what command can be used to test SMTP support?
HELO
Which of the following is a valid SQL statement for adding a new row of data to a SQL database table?
INSERT INTO users (firstname, lastname) values ('George', 'Washington');
Which of the following packages should be installed in order to integrate certain authentication functions with Microsoft's Active Directory?
Kerberos
Which of the following options is passed to the Linux kernel from the GRUB2 configuration file to set the locale?
LANG
Which of the following types of DNS records need to be configured to facilitate email delivery?
MX
Which of the following are examples of multifactor authentication?
Password and PIN
Which of the following package managers are used to install RPM packages on the SUSE or openSUSE distributions by default?Group of answerchoices
Zypper
Which of the following is the common escape sequence to display a horizontal tab using the echo command?
\t
Which of the following commands can you use to list users who have been locked out by pam_faillock.so?
faillock
A file is symbolically linked to another file. Both files share the inode number.
false
A user's home directory is the highest level of the Linux file system hierarchy.
false
All Linux partitions must use the same filesystem.
false
All versions of the grep command are able to use pattern-matching to find file names and file contents.
false
Both the grep command and the find command can be used to search the contents of a file.
false
By default, users are logged into the root directory.
false
By default, vi opens in Insert Mode.
false
Emacs is the most popular Linux command-line text editor.
false
Linux and UNIX are the same operating system.
false
Linux commands are case-insensitive.
false
Linux is the most popular operating system for desktops, servers, and supercomputers.
false
Most modern operating systems are descendants of Microsoft DOS.
false
The Linux file system structure is identical to the Windows operating system's file system structure.
false
The find command searches the underlying file system database, whereas the locate command search the actual file system (and is, therefore, slower).
false
The rmdir command removes a directory and its contents (i.e., any files or other directories it contains).
false
There are very few Linux distributions available.
false
UNIX was created by Steve Jobs and Steve Wozniak.
false
This version of the grep command doesn't allow for pattern-matching using regular expressions.
fgrep
If you suspect that you have bad blocks on a filesystem, which of the following commands can be used to try and repair the filesystem?
fsck
Which command can be used to download an updated copy of the master branch from the original Git repository?
git pull origin master
What is the most popular/used Linux desktop environment?
gnome
Ubuntu, CentOS, and Fedora are all examples of the many Linux distributions.
true
Which of the following is a special group that provides its members with the ability to run the su and sudo commands?
sudoers
Which of the following commands will set the default runlevel of a Linux system?
systemctl set-default runlevel5.target
Which of the following is a valid Linux initialization process?
systemd
Which of the following commands will display a list of Systemd units sorted by the time they took to load?
systemd-analyze blame
Which of the following options for the tar command will create an archive that is also gzipped while displaying all of the work in progress to the terminal screen?
tar -czvf
If a system appears to be having issues with performance for read and write operations to a hard disk, which of the following is not a valid scheduling method that you could try to improve performance?
testwr
Which of the following options can be specified in the GRUB Legacy configuration file to set how long the boot menu is displayed before loading the default image?
timeout
Assume your present working directory is your home directory. Enter the shortest command to create an empty file called myfile in the current working directory. Answer:
touch myfile
A computer's operating system manages all communication between its users and its hardware.
true
A virtual machine is the emulation of a computer from the "metal up."
true
Changes permissions for files use the same rules as those to change permissions for directories.
true
Debian is the base distro for many other Linux distributions, including Ubuntu and Linux Mint.
true
If the search pattern of the grep command includes spaces, quotes must enclose the search pattern.
true
In Linux, a directory is a special type of file that may contain other files (including other directories).
true
In Linux, all users belong to one or more group.
true
In Linux, hidden files begin with the tilde character (i.e., ~).
true
Linux is more stable and reliable than other operating systems.
true
Linux runs on most hardware - even outdated hardware.
true
Metacharacters are similar to Regular Expressions but are associated to defining patterns to match file names instead of a file's content.
true
Regular expressions are used to define patterns.
true
Special permissions can be set on a file or directory using the chmod command.
true
The command used to rename or move a file is the same command used to rename or move a directory.
true
The grep command returns lines that match a specified criteria of a specified file.
true
The more and less commands are functionally equivalent.
true
The touch command creates an empty file by default.
true