Docsity

Linux Essentials - Practice Practice Exam (PASSED!!!, Exams of Computer Science

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
- correct answer
✅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
- correct answer
✅:q! ("colon Q Bang!")
What directory would the ~ character represent?
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28

Partial preview of the text

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

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 - correct answer ✅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 - correct answer ✅:q! ("colon Q Bang!") What directory would the ~ character represent?

Exam (PASSED!!!)

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. - correct answer ✅The home directory of our currently logged in user. What is the default shell for most Linux distributions? csh bash sh zsh - correct answer ✅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

Exam (PASSED!!!)

/etc/profile.d /etc/default /etc/.skel - correct 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 The kernel - correct answer ✅Libraries You are running the ping command to see if a particular host is up. How would you specify to the ping command that only five packets get sent to the remote host? ping --count 5 host.example.com ping -c 5 host.example.com

Exam (PASSED!!!)

ping 5 host.example.com ping -n 5 host.example.com - correct answer ✅ping -c 5 host.example.com (-c = count, number of times can vary) You need to verify that a remote host with a hostname of dns2.linuxacademy.com is up and running. Which of the following commands would you enter at the shell prompt to do this? finger dns2.linuxacademy.com netstat -a dns2.linuxacademy.com netstat -s dns2.linuxacademy.com ping dns2.linuxacademy.com - correct answer ✅ping dns2.linuxacademy.com While using vi to edit a file in command mode, you try to use the BACKSPACE key to delete a word, but nothing happens. What's wrong? You need to use CTRL-BACKSPACE You need to reboot your computer.

Exam (PASSED!!!)

new user newguy user add newguy groupadd newguy - correct answer ✅useradd newguy Which software development model is considered to be less structured than the others? Cathedral Bazaar Scrum Hierarchy - correct answer ✅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"

Exam (PASSED!!!)

echo "hello world" display "hello world" - correct answer ✅echo "hello world" Which file(s) are used for DNS resolution? (Choose 2) /etc/dns /etc/hosts /etc/resolv.conf /etc/resolve - correct 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

Exam (PASSED!!!)

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 - correct answer ✅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? mkdir -r dir1/dir mkdir -c dir1/dir mkdir -p dir1/dir

Exam (PASSED!!!)

mkdir dir1/dir2 - correct answer ✅mkdir -p dir1/dir2 (make directory switch p [for parent] then parent name slash child name) You need to create a symbolic link from a file located at /usr/share/doc/manual to a link in your home directory named 'manual'. Which command would we use to achieve this? ln -s~/manual/usr/share/doc/manual ln -s/usr/share/doc/manual ~/manual ln ~/manual/usr/share/doc/manual ln /usr/share/doc/manual ~/manual - correct answer ✅ln -s/usr/share/doc/manual ~/manual (link -s [for symbolic] /usr/share/doc path, to home directory known as tilde /manual) While working in the command line console, not running X Windows, you suddenly need access to another shell to do another task. You don't want to quit or halt the current application. What might you do to run both your other functions in a shell while still running your current application? You can press ALT-F2 or CTRL-ALT-F2 to open an alternate console screen and access a new shell session.

Exam (PASSED!!!)

Which directory contains filesystem management utilities such as cp or mv? /bin and /usr/bin /usr /root /dev - correct answer ✅/bin and /usr/bin What utility can we use to view manual pages? man nano manual gedit - correct answer ✅man What file might we look at to view our most recently entered shell commands?

Exam (PASSED!!!)

/etc/bash_history ~/.shell_history ~/.bash_history ~/.history - correct answer ✅~/.bash_history What command will print a list of all running processes on our system? top ifconfig ls -la echo $PROCESSES - correct answer ✅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

Exam (PASSED!!!)

man cd cd man cat | man help cd - correct answer ✅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. Yes. However, you will have to purchase a specific email software that is compatible with Linux. Yes. Linux can be configured to provide email services. No. Linux can be configured to provide email services it is not recommended to use more than 25 users. - correct answer ✅Yes. Linux can be configured to provide email services.

Exam (PASSED!!!)

We need to find a file named la.txt in our current directory. Which command would we use? find /home ~name.la.txt search -name la.txt find -name ls.txt find ./-name la.txt - correct answer ✅find ./-name la.txt (this structure ./ signifies "current directory") -- this is our answer, but double-check find -name ls.txt (doubtful this works, since no path) Which file contains the encrypted passwords for the users on a system? /etc/password /etc/passwd /etc/shadow

Exam (PASSED!!!)

8443 - correct answer ✅ 22 Who founded the GNU project? Richard Stallman Richard Berkley Andrew Tanenbaum Linus Torvalds - correct answer ✅Richard Stallman Which of the following services allow us to use shared network printing? (Choose all that apply) Choose 2 Samba

Exam (PASSED!!!)

MySQL Apache CUPS - correct answer ✅SAMBA CUPS When using command completion within a Linux shell, what key should you press? TAB F ENTER DOWN ARROW - correct answer ✅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)