Font size
WorksheetsLinux2 - Lesson 6 (exam training)
Total questions: 40
Worksheet time: 22mins
What command is used to view all variables, local and global?
env
var
echo $var
print $env
What is the use of file /etc/hosts on a linux system?
To map any relevant IP to a hostname
To map any Ip to its relevant IP
To map any hostname to its relevant IP
To map any hostname to its hostname
What file is the configuration file for Samba?
/var/etc/smb.conf
/etc/network/smb.conf
/var/log/smb.conf
/etc/samba/smb.conf
Default Apache stores it's HTML content pages in:
/etc/www
/apache/www
/var/www
/var/www/html
How can I edit a cronjob?
crontab -l
crontab
crontab -e
crontab -m
When using the ping command, how many packets (count) would be sent?
0
1
64
indefinite
What is the DIG command in Linux used for?
Query the hostname
Setup the network
Querying name servers
Check for connectivity
IPv6 is a 128 bit numeric representation of devices over Internet. It supports how many addresses? (Choose 2)
340 trillion, trillion, trillion unique IP address.
340 million, million, million, million unique IP address
340 thousand unique IP address
2 pow(128) unique IP address
In Linux, drivers are referred to as?
Components
Segments
Kernels
Modules
The commands 'ifconfig' and 'ip' can do the exact same things but with different switches (true or false)
true
false
In what situation would an alias in a network be appropriate?
When there is only one IP address needed for a machine.
When you do not like the name of the interface as it exists
When the Linux server needs to talk to a Windows workstation
When you need to have a single host with more than one IP address assigned to the same interface.
What is the protocol that is used for applications where the packet sender does not need to guarantee successful delivery of the data.
TCP
ARP
UDP
SNMP
A system’s______is the friendly name by which other systems or applications can address the system on a network.
domainname
ip-adress
hostname
mac-adress
How to check the default route and routing table?
(more answers can be correct)
route -n
netstat -rn
ip route show
traceroute
How to check which ports are listening in my Linux Server?
tracert
netstat - tulpen
port -l
ip a
What is a correct command for assigning an IP-adress to a NIC?
Ifconfig eth0 172.16.25.130
Ifconfig eth0 -c 172.16.25.130
ifconfig -ip 172.16.25.130
Ifconfig eth0 down; Ifconfig eth0 172.16.25.130; Ifconfig eth0 up
The route cache is a kernel component enabling route lookups to be faster by caching the results in a table. What command to use to check the kernel routing info?
route
route -n
traceroute
route -Cn
What is the correct syntax for a Secure Copy command, to copy the file "foobar.txt" from the local host to a remote host?
scp foobar.txt your_username@remotehost.edu:/some/remote/directory
scp foobar.txt remotehost.edu:/some/remote/directory -u your_username
your_username@remotehost.edu:/some/remote/directory foobar.txt
scp -u your_username@remotehost.edu:/some/remote/directory foobar.txt
What command can be used to force a password change at next login for the user TESTUSER?
passwd –e TESTUSER
passwd -f TESTUSER
passwd -np TESTUSER
passwd -p TESTUSER
What is a correct syntax when using the 'chown' command (more answers can be correct)
chown <filename> <new owner)
chown user:group <filename>
chown user: <filename>
chown 777 <filename>
When coding a Linux script; a conditional statements can be used to see: (Multiple correct answers)
if two string variables or values match (or not)
if two numeric variables or values match (or not)
if a previous step of your script has ended abnormaly
the status of files (if they exist, are a directory, etc)
What is a correct Linux command to check if the Samba service is running?
systemctl status smbd
smb - check
samba -check
service status smb
Which port is the default SSH port?
9999
22
2222
8080
What is the name of the package manager on Red Hat Linux system
yum
grub
rpm
apt
What is a correct syntax to connect to a mysql database called ‘mydb’ with the root user?
mysql mydb -u root
mysql –u root –p mydb
mysql -db mydb -u root
mysql connect mydb -u root
What will happen if you enter ‘dmesg’ on the command prompt under the Root user?
You will enter te DiskMessages menu, for Storage configuration
You sent direct messages to all logged-in users on the system
You will see the direct messages, which are normally shown when you log in.
You can view the Kernel ring buffer for debugging issues
what command can be used in a script to show a blank screen
clean
clear
clr
cln
What command do you use to create a ‘shortcut’ for a file or directory
sc
cp -sc
ln
cp -link
What command can you use to check who is logged on, on your Linux server?
(one or more commands might be correct)
id
who
w
cat /etc/login
login
In VI which command saves your edited file and end the VI-editor?
quit <enter>
endsave <enter>
wq! <enter>
se <enter>
What command do you use to display the last 25 commands issued under the current user and write to a file /tmp/last25cmds?
last | grep 25 | /tmp/last25cmds
echo $lastcommand | grep 25 > /tmp/last25cmds
last -25 | cat /tmp/last25cmds
history | tail -25 > /tmp/last25cmds
The correct command to create a compressed tar-ball named ‘tarbal.tgz’ of the directory ‘files’ ? (asuming that the directory is present in current working directory)
tar -f tarbal.tgz files
tar -czf tarbal.tgz files
tar -compress /files tarball.tgz
tar -xf tarball.tgz /files
After making multiple unsaved edits to a text file using Vim, what command allows exiting the editor without keeping the changes?
:quit
:x
:wq!
:q!
The permission -rwxr--r-- represented in octal expression will be
777
744
666
711
how to change your current working directory to one-level higher (eg: from /var/home/ to /var)
cd
cd ~
cd ..
cd !
A correct command to shutdown your Linux-server:
sudo shutdown -h now
sudo -sh
sudo hold
sudo reboot -h
how to start a script, assuming it has execute-rights and exists in the current directory
/<scriptname>
.<scriptname>
./<scriptname>
exec <scriptname>
when using the command 'sudo cp -R /tmp/* .' in your home-directory what will happen?
all files from /tmp will be copied into your home-dir in reverse order
all read-only files from /tmp will be copied to your home-dir
all subdirectories inside /tmp will be copied to your home-dir
/tmp and all subdirectories inside will be copied to your home-dir
The correct command in Linux to restart the SSH daemon is:
systemctl ssh restart
sudo service restart sshd
sshd restart now
sudo systemctl restart ssh
What command to reboot a Linux server of VM, when working under the root-user?
reboot now
restart now
kernal -r now
os-restart now
