Docsity

Linux Essentials - Practice Exam 2024, Exams of Advanced Education

Toggle sidebar
bg1
Linux Essentials - Practice Exam 2024
If you wanted to disable a second network interface in Linux, what command would you
enter at the shell?
ifdown eth0
ifdown eth1
ifconfig disable eth1
ifdown - ANS-ifdown eth1
You have been editing a configuration file using vi. You realize that you've made many
mistakes and need to quit without saving the changes so that you can start over. Which
command will allow you to do this?
:q
:q!
:exit
:s - ANS-:q! ("colon Q Bang!")
What directory would the ~ character represent?
Another user's home directory.
The home directory of our currently logged in user.
Take us to the home directory of the root user.
The /var directory. - ANS-The home directory of our currently logged in user.
What is the default shell for most Linux distributions?
csh
bash
sh
zsh - ANS-bash
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14

Partial preview of the text

Download Linux Essentials - Practice Exam 2024 and more Exams Advanced Education in PDF only on Docsity!

Linux Essentials - Practice Exam 2024

If you wanted to disable a second network interface in Linux, what command would you enter at the shell? ifdown eth ifdown eth ifconfig disable eth ifdown - ANS-ifdown eth You have been editing a configuration file using vi. You realize that you've made many mistakes and need to quit without saving the changes so that you can start over. Which command will allow you to do this? :q :q! :exit :s - ANS-:q! ("colon Q Bang!") What directory would the ~ character represent? Another user's home directory. The home directory of our currently logged in user. Take us to the home directory of the root user. The /var directory. - ANS-The home directory of our currently logged in user. What is the default shell for most Linux distributions? csh bash sh zsh - ANS-bash

You need to troubleshoot a hardware issue. Which command would let you view the kernel ring buffer to see what hardware was just added? cat /var/log/boot.log tail lastlog dmsg | less head /var/log/messages - ANS-dmsg | less (driver messages) "dmsg pipe less" Which of the following sections give a brief review of the syntax used for a particular command or utility within a man page? REVIEW SYNOPSIS SYNTAX DESCRIPTION - ANS-SYNOPSIS In which directory could you add files so that a newly created user will automatically have them when they first log in? /etc/skel /etc/profile.d /etc/default /etc/.skel - ANS-/etc/skel (correct?) Which of the following provides binary files containing prewritten code elements or interfaces that programmers can call when writing Linux programs? Libraries Bash shell profiles Kernel modules The kernel - ANS-Libraries

gunzip (wrong!!!) it's for gzipped files (.gz) only, and tar does not provide compression on it's own. Bunnyzip2 is not a valid command (it's a typo!) How would you add a new user account to a system? useradd newguy new user newguy user add newguy groupadd newguy - ANS-useradd newguy Which software development model is considered to be less structured than the others? Cathedral Bazaar Scrum Hierarchy - ANS-Bazaar Which command in a script would display the text "hello world" to the screen, followed by a new line? print "hello world" printf "hello world" echo "hello world" display "hello world" - ANS-echo "hello world" Which file(s) are used for DNS resolution? (Choose 2) /etc/dns /etc/hosts /etc/resolv.conf /etc/resolve - ANS-/etc/hosts /etc/resolv.conf

An application has the following permissions set on it: rw-r--r-- Yet it does not run. Why is that? 'Other" has read access to it There is no execute permission set The application is in the wrong directory The application is not in the $PATH - ANS-There is no execute permission set What protocol is used by network programs/applications that need very low latency and, therefore, can tolerate a degree of unreliability? SMTP Internet Message Protocol User Datagram Protocol Transmission Control Protocol - ANS-User Datagram Protocol - UDP is a 'connection- less' protocol and does not require an acknowledgement (no check for reliability) from the receiving end of the communication. Transmission Control Protocol (TCP) ?? NO!!!!! How would you set permissions on a newly created script so that it could be executed. chown u+x script.sh chmod u-x script.sh chmod u+x script.sh chown u-x script.sh - ANS-chmod u+x script.sh +x means add execute -x means remove execute What is the proper syntax for creating a parent directory, followed by a child subdirectory?

apropos postfix search postfix - ANS-apropos postfix man -k postfix (you must be root to use this) Which directory contains filesystem management utilities such as cp or mv? /bin and /usr/bin /usr /root /dev - ANS-/bin and /usr/bin What utility can we use to view manual pages? man nano manual gedit - ANS-man What file might we look at to view our most recently entered shell commands? /etc/bash_history ~/.shell_history ~/.bash_history ~/.history - ANS-~/.bash_history What command will print a list of all running processes on our system? top ifconfig ls -la echo $PROCESSES - ANS-top (top hat hat view of p - stands for processes)

Which of the following commands would you use to view a default gateway address on your system? (choose 2) ifconfig route ip addr show netstat -r - ANS-route (think of a map showing routes, gateway would be the doorway from your house or office to the rest of the world) netstat -r (network status -r standing for 'route') Which commands would you run to see who is currently logged into the system? (choose 2) w whoami where is who - ANS-who w If we wanted to learn about all the available options for the cd command, how might we display its manual page? man cd cd man cat | man help cd - ANS-man cd You have a project where you have to build an email server for your organization of around 200 employees. You are thinking of using a Linux system to accomplish this. Would it be possible to achieve this? No. No currently-available commercial-level email software suite will run on Linux.

First hit the ESC key, then the space bar. - ANS-First hit the ESC key, then the shift + R keys. (Nathan tried this, and it worked!) By default, which port does the sshd daeman listen on for incoming SSH connections? 22 80 443 8443 - ANS- Who founded the GNU project? Richard Stallman Richard Berkley Andrew Tanenbaum Linus Torvalds - ANS-Richard Stallman Which of the following services allow us to use shared network printing? (Choose all that apply) Choose 2 Samba MySQL Apache CUPS - ANS-SAMBA CUPS When using command completion within a Linux shell, what key should you press? TAB F

ENTER

DOWN ARROW - ANS-Tab The users in your organization are having issues accessing the corporate e-mail server, hosted by a third-party vendor. You suspect that a router may be down somewhere within your organization's network. Given that the hostname of the e-mail server is pop.linuxacademy.com, which of the following commands would you enter at the shell prompt to test this? (Choose all that apply) Choose 2: traceroute pop.linuxacademy.com tracepath pop.linuxacademy.com finger pop.linuxacademy.com ping pop.linuxacademy.com - ANS-traceroute pop.linuxacademy.com tracepath pop.linuxacademy.com Which statements are true about hardware MAC addresses? (Choose all that apply) Choose 2: They are unique identifiers The MAC address is dynamically assigned by the operating system The MAC address is hard-coded to the NIC They can resolve names via DNS - ANS-They are unique identifiers The MAC address is hard-coded to the NIC Besides man, what other text-mode utility can you use to get help in Linux? man is the only text mode help utility in Linux Ask a friend. info A search engine - ANS-info

man -s sshd apropos smbd man -k smbd search sshd | man - ANS-apropos smbd man -k smbd Which section of a man page contains administrative utilities used by the root user? 7 3 1 8 - ANS- You need to move a directory (dir1), along with all of its contents, to a new location (dir2). Which command would accomplish this task? cp -R ~/dir11 ~/dir mv -R ~/dir1 ~/dir mv ~/dir1 ~/dir mv -r ~/dir1 ~/dir2 - ANS-correct: mv ~/dir1 ~/dir2 (it's that simple) the move command will take ALL contents along... only copy or cp will make a copy, but not move it.


mv -R ~/dir1 ~/dir2 (move -R means recursive, or take all, from ~/dir1 ~/dir2) NO!!! the mv command does not have a recursive flag available!!! recursive means "all it's contents" but it is not needed to perform a move task You need to delete the /APP directory within your user's home directory. Given that it has child folders and files in it, which is the best command to do this? rm -rf ~/APP rmdir ~/APP

rmdir /APP cp -r/APP - ANS-rm -rf ~/APP (remove -recursive (all) -force to location ~/APP) double check! Which command would copy all files ending in .pdf to the Documents directory? mv .pdf Documents/ cp .pdf Documents/ cp *.pdf Documents/ cp ?.pdf Documents/ - ANS-cp *.pdf Documents/ Which of the following are actual roles of the Linux filesystem? (Choose all that apply) Choose 2: Provide the users with a graphics user interfaces To preserve data integrity Being able to locate data easily To create automatic backups - ANS-To preserve data integrity Being able to locate data easily From your current location on the file system, how would you change to three directories above the current directory? cd ../../.. cd ././. cd ././. cd ./../... cd 3up - ANS-cd ../../.. What environmental variable might we use to specify the directory where man page files will be located?

/opt /etc /var /bin - ANS-/etc (ALL Config files are here) all the system info and etcetera Which software movement is against proprietary software? FLOSS FOSS FSF OSI - ANS-FSF (Free Software Foundation) Which of the files below will configure the path to the man page's files? /etc/man.conf /var/log/man.conf /etc/man_db.conf ~/.MANPATH - ANS-~/.MANPATH /etc/man.conf You've downloaded an application package that has an extension of .rpm. What is required to install it on your Linux system? pacman Debian Package Management System APT Red Hat Package Management System - ANS-Red Hat Package Management System

What commands will tell us what our IP address is on our Linux system? (Choose all that apply) Choose 2: show route ip addr show ifconfig ipconfig - ANS-ip addr show ifconfig Which of the following shell commands will load the ssh client and connect as the 'stephen' user to an ssh server with an IP address of 172.16.10.123? (Choose all that apply) Choose 2: ssh [email protected]. ssh -D stephen 192.168.1. ssh -l stephen 172.16.10. sshd l stephen 172.16.10.123 - ANS-ssh [email protected]. ssh -l stephen 172.16.10.123 (-l stands for 'login name') You are in charge of installing a new Linux server. This Linux server will be used to host a high load production database application that will be used by a large number of users. Which might be the best Linux distribution to choose for this mission-critical application server, with consideration for out-of-box configuration? (Choose all that apply) Choose 2: SUSE Linux Enterprise Server OpenSuse Ubuntu Server

/bin/bash #!shebang #/bin/bash #!/bin/bash - ANS-#!/bin/bash As you are editing a file in vi, you find a word that needs to be deleted. You place your cursor at the beginning of that word. What command will delete this word without deleting the space that follows after our word? dw de q! d - ANS-de d = delete e = word under cursor, and will RETAIN THE SPACE AFTER WRONG!!!! dw (delete word only, but will not RETAIN THE SPACE AFTER) As a developer, your supervisor wants you to download the source code for the latest Linux kernel and then modify it to support a custom application that your organization is developing in-house. Given the current kernel open source licensing is this possible to do? No, the copyright on the source code won't permit it. You can download it buy pay royal fees. No, the source code for open source applications is not available on the internet. Yes, you can create a new Linux flavor and even redistribute it as long as the source code will remain freely available. - ANS-Yes, you can create a new Linux flavor and even redistribute it as long as the source code will remain freely available. You have just copied an executable file called pinehead.sh from our company's server to your ~/Downloads directory. You have changed to the ~/Downloads directory at your shell prompt. When you entered pinehead.sh as a command in the prompt, the shell

tells us that the command is invalid. What possible things could we do? (Choose all that apply) Choose 2: Type out the full path leading up to the filename. Move your file to your Home directory and then try running it. Change the permissions on the file. Add a ./ before our filename. - ANS-Type out the full path leading up to the filename. Add a ./ before our filename. What section within a man page provides a list of man pages or other resources that are related to the command or utility? DESCRIPTION VERSION SEE ALSO REFERENCES - ANS-SEE ALSO (other) When it comes to bash configuration files, which one of these files would be read first when a login bash shell is run? ~/.bash_profile /etc/profile ~/.profile ~/.bashrc - ANS-~/.bashrc (the 'c' refers to configuration of bash) We got 65 of 71 correct - ANS-