1/56
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
You need to troubleshoot a hardware issue. Which command would let you view the kernel ring buffer to see what hardware was just added?
dmsg | less
In which directory could you add files so that a newly created user will automatically have them when they first log in?
/etc/skel
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 -c 5 host.example.com
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?
ping dns2.linuxacademy.com
Which command would uncompress the contents of the file 'important.bz2'?
bunzip2
How would you add a new user account to a system?
useradd newguy
Which file(s) are used for DNS resolution? (Choose 2)
/etc/hosts
/etc/resolv.conf
How would you set permissions on a newly created script so that it could be executed.
chmod u+x script.sh
What is the proper syntax for creating a parent directory, followed by a child subdirectory?
mkdir -p dir1/dir2
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/usr/share/doc/manual ~/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.
You need to search for man pages that relate to the Postfix service. Which command will do this? (Choose 2 correct answers)
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
What file might we look at to view our most recently entered shell commands?
~/.bash_history
We need to find a file named la.txt in our current directory. Which command would we use?
find . -name la.txt
Which file contains the encrypted passwords for the users on a system?
/etc/shadow
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
What is the syntax to change the group ownership on a file?
chgrp group file.txt
Which command would send the output of the 'who' command to a text file?
who > who.txt
You need to move a directory (dir1), along with all of its contents, to a new location (dir2). Which command would accomplish this task?
mv ~/dir1 ~/dir2
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
Which command would copy all files ending in .pdf to the Documents directory?
cp *.pdf Documents/
From your current location on the file system, how would you change to three directories above the current directory?
cd ../../..
When it comes to bash configuration files, which of the following will be read/executed when logging into a shell that is considered to be a non-login shell?
~/.bashrc
Which of the files below will configure the path to the man page's files?
~/.MANPATH
/etc/man.conf
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 stephen@172.16.10.123
ssh -l stephen 172.16.10.123
How might we find out what directory paths are currently set up on our Linux file system? (Choose all that apply)Choose 2:
env
echo $PATH
What should the first line of a bash shell script contain?
#!/bin/bash
Whichi of the following permissions are set on the /tmp/directory?
rwxrwxrxt
Which command adds the new user tux and creates the user’s home directoy with default configuration files?
useradd -m tux
Which of the following commands sorts the output of the command export-logs?
export-logs | sort
Which of the following commands will search for the file foo.txt under the directory /home?
find/home -name foo.txt
Which of the following directories contains information, documentation and example configuration files for installed software packages?
/usr/share/doc/
A directoy contains the following 3 files:
texts 1.txt
texts 2.txt
texts 3.csv
Which command copies the 2 files ending in .txt to the /tmp/ directory?
cp*.txt/tmp/
Which of the following devices represents a hard disk partition?
/dev/sda2
Which files are the source of the information in the following output? Choose 2
uid=1000 (bob) gid=1000 (bob) groups=1000 (bob), 10 (wheel), 150 (wireshark), 989 (docker), 1001 (libvirt)
/etc/passwd
/etc/group
Which command copies the contents of the directory /etc/, including all sub-directories, to /root/?
cp -r /etc/* /root
Which of the following commands puts the lines of the file data.csv into alphabetical order?
sort data.csv
Which of the following commands creates the ZIP archive poems.zip containing all files in the current directory whose names end in .txt?
zip poems.zip *.txt
Which of the following commands will search for the file foo.txt under the directory /home?
find /home –name foo.txt
Which of the following commands output the content of the file Texts 2.txt? (Choose two.)
cat Texts\ 2.txt
cat 'Texts 2.txt’
The current directory contains the following file: -rwxr-xr-x 1 root root 859688 Feb 7 08:15 test.sh Given that the file is a valid shell script, how can this script be executed? (Choose two.)
./test.sh
bash test.sh
Which permissions are set on a regular file once the permissions have been modified with the command chmod 654 file.txt?
-rw-r-xr- -
Which of the following commands extracts the contents of the compressed archive file1.tar.gz?
tar -xzf file1.tar.gz
Which of the following values could be a process ID on Linux?
21398
The ownership of the file doku.odt should be changed. The new owner is named tux. Which command accomplishes this change?
chown tux doku.odt
Which of the following outputs could stem from the command last?
root tty2 Wed May 17 21:11 - 21:11 (00:00)
Reverse DNS assigns hostnames to IP addresses. How is the name of the IP address 198.51.100.165 stored on a DNS server?
In the PTR record for 165.100.51.198.in-addr.arpa.
Which of the following outputs comes from the command free?
total used free shared buff/cache available
mem: 16123128 12565680 2011624 412128 1545824 7180416
Which of the following commands creates an archive file work.tar from the contents of the directory ./
work/?
tar -cf work.tar ./work/
Running the command rm Downloads leads to the following error:
rm: cannot remove 'Downloads/': Is a directory
Which of the following commands can be used instead to remove Downloads, assuming Downloads is empty? (Choose two.)
rmdir Downloads
rm -r Downloads
Which of the following commands adds the directory /new/dir/ to the PATH environment variable?
export PATH=/new/dir: $PATH
A user is currently in the directory /home/user/Downloads/ and runs the command
ls ../Documents/ Assuming it exists, which directory's content is displayed?
/home/user/Documents/
Which of the following examples shows the general structure of a for loop in a shell script?
for file in *.txt
do
echo $i
done
The file script.shin the current directory contains the following content:
#!/bin/bash
echo $MYVAR
The following commands are used to execute this script:
MYVAR=value
./ script.sh
The result is an empty line instead of the content of the variable MYVAR. How should MYVAR be set in order to
make script.sh display the content of MYVAR?
export MYVAR=value
Which of the following commands finds all lines in the file operating-systems.txt which contain the term linux, regardless of the case?
grep -i linux operating-systems.txt
You need to search for man pages that relate to the Samba daemon. Which command will do this? Choose 2 correct answers:
apropos smbd
man -k smbd