0% found this document useful (0 votes)
19 views13 pages

Linux 9-16 Exams

This document contains the correct answers to various questions about Linux commands and concepts. It covers topics such as the echo command, shell scripts, environment variables, user administration, file permissions, networking, processes, and more. In total, there are answers to 15 different exams on Linux fundamentals.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views13 pages

Linux 9-16 Exams

This document contains the correct answers to various questions about Linux commands and concepts. It covers topics such as the echo command, shell scripts, environment variables, user administration, file permissions, networking, processes, and more. In total, there are answers to 15 different exams on Linux fundamentals.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Exam 9

CORRECT- See Section 9.2


The echo command:

✔ It is used to output text to the console

CORRECT- See Section 9.2


A file starts with #!/bin/csh. This means:

✔ The execution of the script will invoke /bin/csh to interpret the rest of
file

CORRECT- See Section 9.3


Most of the nano commands take the form of:

✔ Control and another character

CORRECT- See Section 9.4.2


What does this shell script do? FOO=/tmp/foo if [ ! -d $FOO ]; then mkdir $FOO fi

✔ Create /tmp/foo if it does not exist

CORRECT- See Section 9.4.1


Given the following part of the script: if [ -f $1 ]; then echo "I am here" fi What is the
meaning of $1?

✔ It is the first argument passed to the script.

CORRECT- See Section 9.4.1


Given the following sequence of commands that is executed through ./[Link]
hello goodbye: if [ -f $2 ]; then echo "I am here" fi When will "I" be printed
am here"?

✔ If a file named 'goodbye' exists in the current directory

CORRECT- See Section 9.4.1


What is the correct way to assign the word 'Hello' to a variable?

✔ A=”Hello”

CORRECT- See Section 9.4.1


What is the correct way to save the current directory to a variable?

✔ A=`pwd`

CORRECT- See Section 9.4.1


Which shell command accepts user keyboard input?

✔ read

CORRECT- See Section 9.4.1


What information does it contain inside $? ?

✔ The exit code of the previous command

Exam 10

CORRECT- See Section 10.2


A CPU flag...

✔ ...defines the features supported by the CPU.

CORRECT- See Section 10.2


64-bit platforms can access more memory than platforms
32 bit. True or false?

✔ True

CORRECT- See Section 10.3


What command displays the information of SMBIOS?

✔ dmidecode
CORRECT- See Section 10.5
A partition of a hard drive can be referred to as a
_______.

✔ partition

CORRECT - See Section 10.5


The fdisk command is a tool used to work with disks.
with an MBR partition. True or false?

✔ True

CORRECT- See Section 10.5


Which of the following is the valid device file name for the
first IDE hard drive in the system?

✔ /dev/hda

Exam 11

CORRECT- See Section 11.2.2


What does the acronym RPM mean?

✔ RPM Package Management

CORRECT - See Section 11.2


One way to install new software on a Linux system is to use a
Package management system. True or false?

✔ True

CORRECT- See Section 11.9


When you run the dmesg command, the system displays the messages that are
They are generated by the kernel. True or false?

✔ True
CORRECT- See Section 11.3
The /proc directory contains a subdirectory for each process present in the
system. True or false?

✔ True

CORRECT- See Section 11.3


The process identifier (PID) of the init process is

✔1

CORRECT- See Section 11.7


The free command shows statistics about:

✔ The use of memory

CORRECT- See Section 11.5


The process command (ps) only shows the processes that are running in the
Default shell. True or false?

✔ True

CORRECT - See Section 11.8


Which directory normally contains the log files?

✔ /var/log

CORRECT- See Section 11.8


Which log file contains the messages related to the
authentication and authorization?

✔ secure
CORRECT- See Section 11.8
All log files only contain text data. True or
false?

✔ False

Exam 12

CORRECT- See Section 12.2


Which of the following would be considered a host?

✔ A printer connected to the network via an IP address

CORRECT- See Section 12.2


A service is ...

✔ ...a feature provided by one computer to another.

CORRECT- See Section 12.3


Only servers have host names. True or false?

✔ False

CORRECT- See Section 12.3


Which of the following protocols defines how communication works?
red?

✔ TCP/IP

CORRECT- See Section 12.6.1


The name of the network devices with primary cables is ether0. True
or false?

✔ False

CORRECT- See Section 12.6.1


Which of the following commands will show your machine's ID address?

✔ ifconfig

WRONG- See Section 12.6.7


Which of the following commands will allow you to log in to a machine?
remote?

✗ route

CORRECT- See Section 12.6.4


Which option of the netstat command contains the information displayed as
numbers instead of names?

✔ -n

CORRECT- See Section 12.6.7


Which of the following commands will allow you to log in to the
machine server1 with the account name nick?

✔ ssh nick@server1

WRONG- See Section [Link]


The RSA fingerprint key allows the dig command to connect to
remote systems. True or false?

✗ True

Exam 13

CORRECT- See Section 13.2.2


Which of the users can see the file /etc/shadow?

✔ The root user

CORRECT- See Section 13.2.4


What command will show the UID, GID, and the groups you belong to?
current user?

✔ id

CORRECT- See Section 13.1


Each user belongs to at least one group. True or false?

✔ True

CORRECT - See Section 13.7


What command will be shown to users who have logged in on the
system?

✔ who

CORRECT- See Section 13.6.1


The sudo command allows regular users to...

✔ ...execute certain commands as the root user.

CORRECT- See Section 13.6.1


The /etc/sudoers file must be edited directly by root with the command
visudo. True or false?

✔ True

CORRECT- See Section 13.6.1


What default editor does the visudo command use?

✔ vi

CORRECT- See Section 13.2.4


Which of the following commands will show the group/groups to which
Does the user belong?

✔ id
CORRECT- See Section 13.3.1
What structure does the /etc/group file follow?

✔ group_name:password_placeholder:GID:user_list

CORRECT- See Section 13.3.1


A GID is associated with a group name. True or false?

✔ True

Exam 14

CORRECT- See Section 14.7.1


What type of users are the UID 1-500 generally reserved for?

✔ System accounts, such as server processes

CORRECT- See Section 14.12


Si se elimina un usuario, los archivos y directorios que el usuario pertenece...

✔ ...will show a UID as an owner, but not the name of


user.

CORRECT- See Section 14.7.1


Which of the following options for the useradd command allow root to
specify the UID to associate it with the account?

✔ -u

CORRECT- See Section 14.7.1


Which of the following options for the useradd command allows root to
Specify the supplementary groups of which the user will be a member?

✔ -G

CORRECT- See Section 14.7.1


In a system that does not use UPG, the useradd command will also create a
user group. For example, user bob, group bob. True or
false?

✔ False

CORRECT - See Section 14.7.1


The useradd command will create a home directory by default.
for a user. True or false?

✔ True

CORRECT- See Section 14.11.1


The usermod command can be used to do everything except ...

✔ ...change the user's MAX and MIN password settings.

CORRECT- See Section 14.11.1


Which of the following commands will add the extra group to the groups of the
user bob in addition to bob's current secondary groups?

✔ usermod -aG extra bob

CORRECT- See Section 14.9


For non-root users, the passwd command can only be used
to change the password of the user executing the command. True or
false?

✔ True

CORRECT- See Section 14.12


The command userdel ...

✔ ...will delete the user account but leave the user's files intact.
defect.
Exam 15

CORRECT- See Section 15.6.2


Which of the following commands sets the 'other' permissions for
the file is r-x?

✔ set permissions for others to read and execute on file

CORRECT - See Section 15.6.3


Which of the following commands sets the 'other' permissions for
is the file a r-x?

✔ chmod 775 file

CORRECT- See Section 15.6.2


Only one set (user, group, others) of permissions can be changed at a time.
using the symbolic method. True or false?

✔ False

CORRECT- See Section 15.5


The chown command can be used to change the owner and the group of
a file. True or false?

✔ True

CORRECT- See Section 15.6


The sysadmin user can read the file because he is its owner. ----r--r-- 1
sysadmin group 38270 Sep 2 18:49 file True or false?

✔ False

CORRECT - See Section 15.6.2


The sysadmin user will be able to change the file permissions because it is theirs.
owner. ----r--r-- 1 sysadmin group 38270 Sep 2 18:49 file True or
false?

✔ True
CORRECT- See Section 15.6.3
Octal notation uses the following values for granted permissions:

✔ r = 4, w = 2, x = 1

CORRECT- See Section 15.6


Which of the following permissions would allow all users to add, view and
delete the files in a directory?

✔ 777

CORRECT- See Section 15.6


A user cannot delete a file unless they are its owner. True or
false?

✔ False

CORRECT- See Section 15.6


The 'execute' permission on a file allows you to:

✔ Run the file as a script

Exam 16

CORRECT- See Section 16.8


/tmp is a temporary directory and will not exist on a system in
At all times. True or false?

✔ False

CORRECT- See Section 16.8


/var directory has files that change over time. True or
false?

✔ True
CORRECT- See Section 16.6
The 'sticky bit' permission...

✔ the others cannot delete the files that do not belong to them
owners of a common directory.

CORRECT- See Section 16.6


Which of the following commands will set the 'sticky bit' on the
/shared directory?

✔ chmod 1777 /shared

CORRECT- See Section 16.2


The 'setuid' permission...

✔ ...allows a command to be executed as the owner of the file.

CORRECT- See Section 16.2


Which of the following commands will set setuid on the
/usr/bin/program directory?

✔ chmod 4755 /usr/bin/program

CORRECT- See Section 16.5


Which of the following commands will set setgid on the /shared directory?

✔ chmod 2777 /shared

CORRECT- See Section 16.7.3


Deleting a source file will break an associated physical link.
True or false?

✔ False

CORRECT- See Section 16.7.3


A source and a physical link must be part of the same file system.
True or false?

✔ True

CORRECT- See Section 16.7.3


Deleting a source file will break an associated symbolic link.
True or false?

✔ True

You might also like