Docsity

Linux Essentials - Practice Practice Exam PASSED!!!, Exams of Nursing

Toggle sidebar
bg1
Linux Essentials - Practice Practice
Exam PASSED!!!
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 - ANSWERifdown 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 - ANSWER: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. - ANSWERThe home directory of our currently logged in user.
What is the default shell for most Linux distributions?
csh
bash
sh
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15

Partial preview of the text

Download Linux Essentials - Practice Practice Exam PASSED!!! and more Exams Nursing in PDF only on Docsity!

Linux Essentials - Practice Practice

Exam PASSED!!!

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 - ANSWERifdown 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 - ANSWER: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. - ANSWERThe home directory of our currently logged in user. What is the default shell for most Linux distributions? csh bash sh

zsh - ANSWERbash 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 - ANSWERdmsg | 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 - ANSWERSYNOPSIS 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 - ANSWER/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

bunzip2 *** bz2 is the key to this answer... use bunzip for bz files!!! - ANSWERbunzip 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 - ANSWERuseradd newguy Which software development model is considered to be less structured than the others? Cathedral Bazaar Scrum Hierarchy - ANSWERBazaar 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" - ANSWERecho "hello world" Which file(s) are used for DNS resolution? (Choose 2) /etc/dns /etc/hosts /etc/resolv.conf

/etc/resolve - ANSWER/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 - ANSWERThere 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 - ANSWERUser 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 - ANSWERchmod u+x script.sh

You need to search for man pages that relate to the Postfix service. Which command will do this? (Choose 2 correct answers) which postfix man -k postfix apropos postfix search postfix - ANSWERapropos 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 - ANSWER/bin and /usr/bin What utility can we use to view manual pages? man nano manual gedit - ANSWERman What file might we look at to view our most recently entered shell commands? /etc/bash_history ~/.shell_history ~/.bash_history ~/.history - ANSWER~/.bash_history What command will print a list of all running processes on our system?

top ifconfig ls -la echo $PROCESSES - ANSWERtop (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 - ANSWERroute (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 - ANSWERwho 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 - ANSWERman cd

insert mode into replace mode. Given that you are already in insert mode, which steps would you take to enter into replace mode? First hit the ESC key, then the R key. First hit the ESC key, then the I key. First hit the ESC key, then the shift + R keys. First hit the ESC key, then the space bar. - ANSWERFirst 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 - ANSWER Who founded the GNU project? Richard Stallman Richard Berkley Andrew Tanenbaum Linus Torvalds - ANSWERRichard Stallman Which of the following services allow us to use shared network printing? (Choose all that apply) Choose 2 Samba MySQL Apache

CUPS - ANSWERSAMBA

CUPS

When using command completion within a Linux shell, what key should you press? TAB F ENTER DOWN ARROW - ANSWERTab 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 - ANSWERtraceroute 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 - ANSWERThey are unique identifiers The MAC address is hard-coded to the NIC

who | who.txt cat who > who.txt echo who > who.txt - ANSWERwho > who.txt You need to search for man pages that relate to the Samba daemon. Which command will do this? (Choose all that apply) Choose 2 correct answers: man -s sshd apropos smbd man -k smbd search sshd | man - ANSWERapropos smbd man -k smbd Which section of a man page contains administrative utilities used by the root user? 7 3 1 8 - ANSWER 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 - ANSWERcorrect: 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 - ANSWERrm -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/ - ANSWERcp *.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 - ANSWERTo 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?

/etc/profile ~/.bash_login ~/.bashrc - ANSWER/etc/profile (/etc contains all the primary system configuration files, bash is typically the default shell, so it's redundant to say ''bash configuration files." WRONG ~/.bashrc In which directory will you find system-related configuration files? /opt /etc /var /bin - ANSWER/etc (ALL Config files are here) all the system info and etcetera Which software movement is against proprietary software? FLOSS FOSS FSF OSI - ANSWERFSF (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 - ANSWER~/.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 - ANSWERRed 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 - ANSWERip 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.

locate path - ANSWERenv (tells you about your current environment) echo $PATH (tell me back $ = any, path) What utility allows us to switch users, including switching to the root user? chuser switchuser chmod su - ANSWERsu use the su command, which stands for "switch user" What should the first line of a bash shell script contain? /bin/bash #!shebang #/bin/bash #!/bin/bash - ANSWER#!/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 - ANSWERde 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. - ANSWERYes, 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. - ANSWERType 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 - ANSWERSEE ALSO (other)