2nd Half Flashcards

1
Q

Error messages generated by commands are sent where by default?

STDERR
STDIN
STDOUT
Log files

A

STDERR

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

A successful command may, or may not print output to STDOUT. True or False?

True
False

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which of the following commands will direct error messages to the file, error.log?

ls /root > error.log
ls /root&raquo_space; error.log
ls /root $> error.log
ls /root 2> error.log

A

ls /root 2> error.log

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

A pipe allows you to…

…send the output of a command to a file.
…type multiple commands at one prompt.
…send the same input to multiple commands.
…send the output of one command to another.

A

…send the output of one command to another.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Channel 2 is

STDIN
STDALL
STDOUT
STDERR

A

STDERR

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Which of the following commands will append its output to output.file?

echo Testing > output.file
echo Testing&raquo_space; output.file
echo Testing -> output.file
output.file < echo Testing

A

echo Testing&raquo_space; output.file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which command(s) can be used to sort the lines of list.file alphabetically and display it on the screen?(choose two)

cat list.file | sort
echo list.file > sort
cat list.file&raquo_space; sort
sort < list.file

A

cat list.file | sort
sort < list.file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Which option of the head command will display only the first five lines of a file?

-l 5
No option needed; head displays only five lines by default.
-n 5
-n

A

-n 5

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

The grep command…

…will display all the lines that begin with the specified Regular Expression.
…will display all the lines in a file containing the specified Regular Expression.
…is not case sensitive.
…will display the line numbers in a file that contain a specified Regular Expression.

A

…will display all the lines in a file containing the specified Regular Expression.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

The grep command can be used with glob characters.True or False?

True
False

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Which of the following commands will display only lines that begin with start?

grep $start file.txt
grep ^start file.txt
grep \start file.txt
grep *start file.txt

A

grep ^start file.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which of the following commands will display only lines that begin with test?

grep test file.txt
grep $test
file.txt
grep &test file.txt
grep ^test file.txt

A

grep ^test file.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Which of the following commands will display lines that contain either start or end?

egrep start end file.txt
egrep ‘start|end’ file.txt
egrep start&end file.txt
egrep (start|end) file.txt

A

egrep ‘start|end’ file.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Which of the following commands can be used to scroll through a text file? (choose two)

some
more
less
cat

A

more
less

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Which option for the cut command is used to specify a delimiter?

=
-D
-f
-d

A

-d

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Which option for the cut command is used to specify the field?

-d
-D
-f
#

A

-f

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Which option for the wc command will print the number of lines in a file?

-L
-w
-C
-l

A

-l

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Which option for the wc command will print the total number of words in a file?

-l
-C
-w
-L

A

-w

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Which command can be used to print line numbers?

nl
ln
num
sort

A

nl

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

The command echo “text” > file.txt will create file.txt if it does not already exist. True or False?

True
False

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

The command echo “text” > file.txt will not overwrite file.txt if it already exists. True or False?

True
False

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

The command echo “text”&raquo_space; file.txt will not overwrite file.txt if it already exists. True or False?

True
False

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

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

Nothing, this is a comment
Running the script will invoke /bin/csh to interpret the rest of the file
The operator should not be using /bin/csh
This is a Perl script
C Shell compatibility mode is enabled

A

Running the script will invoke /bin/csh to interpret the rest of the file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Which are appropriate editors for writing shell scripts?(choose two)

Firefox
/bin/bash
LibreOffice Writer
vi
nano

A

vi
nano

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

Most of nano’s commands take the form of:

Control and another character
Alt and another character
Mouse clicks
Escape followed by another character
The F1 through F12 function keys

A

Control and another character

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

What does this shell script do?

FOO= /tmp/ foo
if [ ! -d $FOO ] ; then
mkd ir $FOO
f i
Creates /tmp/foo if it does not exist
Makes the /tmp/foo directory if a file by that name exists
Creates /tmp/foo and raises an error if there is a problem
Nothing, since there is a problem with the conditions in the if statement
Outputs a message to the screen

A

Creates /tmp/foo if it does not exist

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

Which of the following are correct about for and while loops?​(choose two)

while loops have a test each cycle to determine if it should run again
for loops have a test each cycle to determine if it should run again
while loops operate over a fixed list of items
for loops require a variable over which to iterate
for loops operate over a fixed list of items

A

while loops have a test each cycle to determine if it should run again

for loops operate over a fixed list of items

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

Given the following part of a script:

if [ - f $1 ]; then
echo “I am here”
fi
What is the meaning of $1?

It is a list of files that gets interpolated
It is a file called $1
It is a special variable that indicates the exit code of the command before it
It is a parameter to -f, indicating the size of the file
It is the first argument passed to the script

A

It is the first argument passed to the script

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

Given the following script that is run through ./test.sh hello goodbye:

if [ -f $2 ]; then
echo “I am here”
fi
When will “I am here” be printed?

The script will always print “I am here”
If a file called “goodbye” exists in the current directory
Never
If there are two files in the current directory
If a file called “hello” exists in the current directory

A

If a file called “goodbye” exists in the current directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

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

A = “Hello”
echo “Hello” > A
echo $A “Hello”
$A=”Hello”
A=”Hello”

A

A=”Hello”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

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

A=cwd
pwd $A
pwd | $A
A=pwd
A=`pwd`

A

A=`pwd`

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

Which shell command accepts input from the user’s keyboard?

$1
echo
read
gets
input

A

read

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

What information is held inside $? ?

The name of the command run
The previous command’s exit code
The current process ID
The current user ID
The number of arguments passed to the script

A

The previous command’s exit code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

How would you finish your script with an exit code of 42?

return 42
break 42
CODE=42
$?=42
exit 42

A

exit 42

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

The if command looks for what exit code to consider a condition to be true?

1
2
0
255
10

A

0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

The number of users logged in is in a variable called USERS. How would you test to see if there are 5 users logged in?

test $USERS –a 5
test $USERS,5
test $USERS = 5
test $USERS –eq 5
test –f USERS=5

A

test $USERS –eq 5

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

Given the following script:

while [ ! -f /tmp/foo ] ; do
echo -n “.”
process_data > /tmp/foo
done
Which of the following are true?(choose two)

The screen will fill with dots.
process_data will be called at most once
If a file called /tmp/foo exists, process_data won’t be run
/tmp/foo will be removed if it exists
process_data will never be run

A

process_data will be called at most once
If a file called /tmp/foo exists, process_data won’t be run

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q

A conditional that lets you make multiple comparisons with a pattern is called:

if
test
fanout
case
branch

A

case

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q

What is the meaning of $(( $i + 1)) ?

This will return the value of the next argument to the script
This runs the command stored in variable i
Ifi is 0, the loop will stop
This will return the value of the first argument to the script
1 will be added to the i variable

A

1 will be added to the i variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
40
Q

How would you write a test that says “if /tmp/foo is a directory or USERS is greater than 5″?

test –d /tmp/foo –o $USERS –gt 5
test /tmp/foo || $USERS > 5
test –d /tmp/foo | $USERS > 5
test /tmp/foo –d –o $USERS -gt 5

A

test –d /tmp/foo –o $USERS –gt 5

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
41
Q

Which of the following are valid CPU types for Intel-based platforms?(choose two)

48-bit
24-bit
64-bit
32-bit

A

64-bit
32-bit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
42
Q

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

True
False

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
43
Q

Choose all of the following statements that are true in regard to virtual RAM: (choose three)

Virtual RAM is also called swap space
Virtual RAM is stored in the CPU
Virtual RAM is stored on a hard drive
Virtual RAM is used when available physical RAM is low.

A

Virtual RAM is also called swap space

Virtual RAM is stored on a hard drive
Virtual RAM is used when available physical RAM is low.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
44
Q

Which of the following are common busing systems? (choose two)

CPU
PCI
RAM
BIOS
USB

A

PCI

USB

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
45
Q

A division of a hard drive may be referred to as a _______ .

portion
block
partition
label

A

partition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
46
Q

Which of the following are valid partitioning types?(choose two)

MBR
PC
GPT
BIOS

A

MBR
GPT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
47
Q

The fdisk command is a tool used for working with the MBR partitioned disks. True or False?

True
False

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
48
Q

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

/dev/hda
/dev/hd1
/dev/ide
/dev/sda

A

/dev/hda

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
49
Q

Which of the following are valid video cable connector types?(choose two)

AMD
HDA
VGA
DVI

A

VGA
DVI

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
50
Q

Which of the following commands will display CPU information?(choose two)

showcpu
cpuinfo
arch
lspic
lscpu

A

arch

lscpu

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
51
Q

What are the advantages of solid state disks when compared to traditional spinning platter hard disks?(choose three)

Low power consumption
Low cost
Faster system boot times
Higher capacity
Less heat

A

Low power consumption

Faster system boot times

Less heat

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
52
Q

Software that allows hardware devices to communicate with the installed operating system is called?

Drivers
Programs
Instructions
Packages

A

Drivers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
53
Q

Which of the following commands will check hard disk MBR partitions?(choose three)

gfdisk
fdisk
sfdisk
gdisk
cfdisk

A

fdisk
sfdisk

cfdisk

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
54
Q

Which of the following commands will check hard disk GPT partitions?(choose three)

sfdisk
sgdisk
gfdisk
gdisk
cgdisk

A

sgdisk
gdisk
cgdisk

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
55
Q

When you execute the dmesg command, the system displays messages that are generated by the kernel. True or False?

True
False

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
56
Q

The Linux kernel mounts the following pseudo-filesystems to provide access to information about hardware devices connected to the system: (choose two)

/devices
/sys
/proc
/info

A

/sys
/proc

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
57
Q

The /proc directory contains a subdirectory for each process present on the system. True or False?

True
False

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
58
Q

The Process ID (PID) of the init process is:

1
0
varies
100

A

1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
59
Q

The process (ps) command shows only processes running in the current shell by default. True or False?

True
False

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
60
Q

The following system load averages are displayed by the top command: (choose three)

1 minute
15 minute
10 minute
5 minute

A

1 minute
15 minute
5 minute

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
61
Q

The free command outputs statistics about:

Memory usage
Disk usage
Software usage
CPU usage

A

Memory usage

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
62
Q

What directory typically contains log files?

/proc/loc
/log
/usr/log
/var/log

A

/var/log

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
63
Q

Which log file contains messages regarding authentication and authorization?

syslog
messages
secure
dmesg

A

secure

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
64
Q

All log files contain only text data. True or False?

True
False

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
65
Q

A command that will continuously update statistics about running processes:

head
top
tail
bottom

A

top

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
66
Q

Which of the following is a valid Linux option style for Traditional Unix:

no dash
two dashes (–)
a single dash (-)
slash (/)

A

a single dash (-)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
67
Q

Which file contains the information passed to the kernel at boot time?

/proc/kernel
/proc/cmdline
/proc/kargs
/proc/kopts

A

/proc/cmdline

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
68
Q

To make changes permanent for kernel parameter files found under /proc/sys, the following file can have entries added to it:

/etc/sysinfo.conf
/etc/procctl.conf
/etc/procsys.conf
/etc/sysctl.conf

A

/etc/sysctl.conf

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
69
Q

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

True
False

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
70
Q

Information about the init process can be found in the /proc/1 directory. True or False?

True
False

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
71
Q

Which of the following commands will allow you to view all processes on the system?(choose two)

ps -eLf
ps aux
ps -ef
ps -A
ps

A

ps aux
ps -ef

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
72
Q

The logging daemon on recent Linux distributions based on systemd is called:

klogd
syslogd
rsyslogd
journald

A

journald

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
73
Q

What does the acronym FHS stand for among the the standards supported by the Linux Foundation?

Filesystem Hierarchy Standard
Filesystem Hierarchy Structure
File Hierarchy Standarduestion ID 2151

A

Filesystem Hierarchy Standard

74
Q

Which directory is the root of the filesystem?

/sys
/home
/var
/root
/

A

/

75
Q

The sbin directories are primarily intended to be used by the root user. True or False?

True
False

A

True

76
Q

Which of the following would be considered a host?

A CD-ROM
A printer attached to the network via an IP address
The computer’s hard drive
A network cable

A

A printer attached to the network via an IP address

77
Q

A service is…

…another name for a computer’s hostname.
…a feature provided by one computer to another.
…a file that contains configuration information.
…like an IP address.

A

…a feature provided by one computer to another.

78
Q

A network packet contains …(choose two)

…the name of the router.
…the IP address of the source machine.
…the IP address of the destination machine.
…a hard drive partition.

A

…the IP address of the source machine.
…the IP address of the destination machine.

79
Q

Only servers have hostnames. True or False?

True
False

A

False

80
Q

Which of the following protocols defines how network communication functions?

DNS
DHCP
SSH
TCP/IP

A

TCP/IP

81
Q

Which of the following are valid IPv4 addresses?(choose two)

192.301.25.25
192.105.10.10
10.33.55.77
192.105.10.10.2

A

192.105.10.10
10.33.55.77

82
Q

Which of the following commands will display the IP address on a Linux system?

route
ipconfig
ifconfig
dig

A

ifconfig

83
Q

Which of the following commands will display the routing table?(choose two)

ifconfig
dig
route
netstat -r

A

route
netstat -r

84
Q

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

ssh
route
netstat
dig

A

ssh

85
Q

What option to the netstat command has information shown as numbers rather than names?

-t
-r
-n
–name

A

-n

86
Q

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

ssh nick&server1
ssh nick-server1
ssh nick@server1
ssh nick->server1

A

ssh nick@server1

87
Q

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

True
False

A

False

88
Q

When looking at the primary IPv4 configuration file, if the device was configured to be a DHCP client, then the BOOTPROTO value would be set to none. True or False?

True
False

A

False

89
Q

When issuing the service network restart command, which of the following occurs?

…brings up all network interfaces, re-reads all related configuration files and then the networking for the system is restarted.
…takes down all network interfaces, re-reads all related configuration files and then the networking for the system is restarted.
…the networking for the system is stopped and then started back up.

A

…takes down all network interfaces, re-reads all related configuration files and then the networking for the system is restarted.

90
Q

Which of the following files contains the IP addresses of the name servers the system should consult in any attempt to resolve names to IP addresses?

/etc/hosts
/etc/resolve.conf
/etc/resolv.conf
/etc/nsswitch.conf

A

/etc/resolv.conf

91
Q

Which of the following commands can be used to display socket statistics, and supports all major packet and socket types?

ss
top
ifconfig
route

A

ss

92
Q

Which files contain user account information?
(choose two)

/etc/shadow
/etc/group
/etc/passwords
/etc/passwd

A

/etc/shadow

/etc/passwd

93
Q

Which user can view the /etc/shadow file?

Any member of the password group
No users
The root user
All users

A

The root user

94
Q

Which command will display the UID, GID and groups your current user belongs to?

whoami
Who
id
about

A

id

95
Q

Each user belongs to at least one group.

True or False?

True
False

A

True

96
Q

Which command will display the users that are currently logged in to the system?

about
who
id
whoami

A

who

97
Q

The sudo command allows regular users to…

…execute commands as another user.
…execute any command as root, after providing the root password.
…run any command as root, after providing the sudo password.
…run any commands as a system account without logging in.

A

…execute commands as another user.

98
Q

Which of the following commands will display the group(s) a user belongs to?

all
id
whoami
group

A

id

99
Q

Which of the following commands will display the groups that the user bob belongs to?

group bob
id bob
groups -a
all bob

A

id bob

100
Q

The /etc/group file follows what structure?

group:GID:user_list
groups -a
user:group
group_name:password_placehoder:GID:user_list

A

group_name:password_placehoder:GID:user_list

101
Q

A GID is associated with a group name.

True or False?

True
False

A

True

102
Q

A user can belong to…

At least 16 groups
Only five groups
Only groups with a GID over 500
Only one group

A

At least 16 groups

103
Q

Sudo privileges can be used to specify which user can use the sudo command to execute commands as other users.

True or False?

True
False

A

True

104
Q

In distributions that do not allow the root user to login directly or via the su command, the installation process automatically configures one user account to be able to use the sudo command to execute commands as if they were executed by the root user.

True or False?

True
False

A

True

105
Q

Which of the following commands will display how long the system has been running since the last boot?

(choose two)

who
id
uptime
w

A

uptime
w

106
Q

The /etc/shadow file contains plain-text passwords.

True or False?

True
False

A

False

107
Q

Which command can be used to view the /etc/passwd file entries?

uptime
uppasswd
getpasswd
getent

A

getent

108
Q

All Linux systems allow administrators to log in as root.

True or False?

True
False

A

False

109
Q

What is the default user for the su command?

All users
The root user
Any member of the password group
The most recently created user

A

The root user

110
Q

Which command would allow a user to execute commands as root?

whoami
about
sudo
who
grep

A

sudo

111
Q

File permissions cannot be edited by the root user.

True or False?

True
False

A

False

112
Q

Which command is used to display only the user’s primary group?

who
id -g
man
whoami
about

A

id -g

113
Q

Traditional UNIX systems allowed users to belong to how many groups?

10,000
1
65,000
256
16

A

16

114
Q

What would an account with the UID 376 typically be used for?

White hat hackers.
Temporary employees.
New users with full privileges.
System service access.
Root user access.

A

System service access.

115
Q

Usernames cannot be the same as group names.

True or False?

True
False

A

False

116
Q

To display the group(s) a user belongs to use this command:

all
id
grep
group
whoami

A

id

117
Q

Which command will display the groups that the root user belongs to?

all -t
groups -a
id root
all
group -r

A

id root

118
Q

A value of 0 in the “minimum” password aging field means the user cannot change their password.

True or False?

True
False

A

False

119
Q

The “Epoch” began on January 1, 1970.

True or False?

True
False

A

True

120
Q

The last command displays reboot records…

By default
Never
Only when issued by the root user
After restarting the system
When issued with the -p switch

A

By default

121
Q

Sudo privileges allow users to execute commands as another user.

True or False?

True
False

A

True

122
Q

When using the sudo command to execute a command as the root user, the command prompts for the user’s own password, not that of the root user.

True or False?

True
False

A

False

123
Q

The first line of this command displays how long the system has been running since being rebooted.

su
getent
w
id
who

A

w

124
Q

The /etc/shadow file contains encrypted passwords.

True or False?

True
False

A

True

125
Q

Which command can be used to view the /var/log/wtmp file entries?

getent
uptime
getpasswd
uppasswd
last

A

last

126
Q

UIDs 1-499 are usually reserved for what kind of users?

Remote log-in accounts
Are not used for user accounts, but for group accounts
System accounts, such as server processes
Log-in (human) users

A

System accounts, such as server processes

127
Q

If a user is deleted, the files and directories that the user owned…

…will have no user owner.
…will have no UID owner.
…will show a UID as the owner, but not user name.
…are deleted as well.

A

…will show a UID as the owner, but not user name.

128
Q

Which of the following options for the useradd command allows root to specify the UID to be associated with the account?

-g
-G
-u
-M

A

-u

129
Q

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

-G
-u
-g
-U

A

-G

130
Q

On 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?

True
False

A

False

131
Q

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

usermod -G extra bob
usermod -ag bob extra
usermod -aG extra bob
usermod -a extra bob

A

usermod -aG extra bob

132
Q

Which option for the usermod command can be used to specify a user’s group ID (either primary or secondary)?

(choose two)

-s
-g
-S
-G

A

-g

-G

133
Q

For non-root users, the passwd command can only be used to change the password of the user running the command.

True or False?

True
False

A

True

134
Q

The groupmod command can be used to change a group name.

True or False?

True
False

A

True

135
Q

The groupmod command can be used to change a group GID.

True or False?

True
False

A

True

136
Q

The groupmod command can be used to add users to a group.

True or False?

True
False

A

False

137
Q

Which of the following commands can be used to modify a group?

groupmod
groupadd
modgroup
addgroup

A

groupmod

138
Q

Which command can be used to determine a user’s most recent log in?

history
last
login
shell

A

last

139
Q

Which of the following files contains encrypted user password information?

/etc/usr
/etc/group
/etc/passwd
/etc/shadow

A

/etc/shadow

140
Q

Which of the following files contains user IDs?

/etc/group
/etc/passwd
/etc/usr
/etc/shadow

A

/etc/passwd

141
Q

Which of the following files does the groupadd command use to determine the new GID when a GID isn’t specified?

/etc/usr
/etc/shadow
/etc/passwd
/etc/group

A

/etc/group

142
Q

Which of the following commands, run as root, will prevent the user bob from logging in?

usermod -L bob
usermod -l bob
usermod -D bob
usermod -d bob

A

usermod -L bob

143
Q

What directory contains a user’s home directory?

/user
/
/home
/rootfs

A

/home

144
Q

GIDs under 500 (or 1000) are usually reserved for what kind of groups?

System use
Are not used for groups, but for user accounts
Administrators
User private groups (UPG)

A

System use

145
Q

If a user is deleted, the files and directories that the user owned…

…are deleted as well.
…will have no user owner.
…may be important for others in the organization
…will have no UID owner.

A

…may be important for others in the organization

146
Q

Which of the following options for the useradd command allows you to use a different primary group then the default?

-g
-G
-U
-u

A

-g

147
Q

On a system that uses UPG, the UID must not be the same as the GID..

True or False?

True
False

A

False

148
Q

The usermod command can be used to unlock a users account with the following option.

-s
-u
-f
-U

A

-U

149
Q

Which of the following options for the useradd command allows you to use a different login shell than the default?

-g
-s
-u
-U

A

-s

150
Q

Which of the following commands will add the group extra to the user jane’s secondary groups in addition to jane‘s current secondary groups?

usermod -a extra jane
usermod -ag jane extra
usermod -aG extra jane
usermod -G extra jane

A

usermod -aG extra jane

151
Q

Which option for the usermod command can be used to specify a user’s primary group ID?

-g
-S
-G
-s

A

-g

152
Q

For root users, the passwd command can only be used to change the password of the user running the command.

True or False?

True
False

A

False

153
Q

The userdel -r command will…

…will prompt before deleting each file owned by a user.
…delete the user account, but leave the user’s files by default.
…automatically delete a user and the user’s home directory and mail spool and their contents.
…automatically delete a user and all the files owned by that user.

A

…automatically delete a user and the user’s home directory and mail spool and their contents.

154
Q

The groupmod command can be used to change a group name.

True or False?

True
False

A

True

155
Q

The groupmod command cannot be used to change a group GID.

True or False?

True
Fasle

A

Fasle

156
Q

The groupdel command can be used to delete primary groups.

True or False?

True
Fasle

A

Fasle

157
Q

Which of the following commands can be used to modify a user?

adduser
moduser
useradd
usermod

A

usermod

158
Q

Which command can be used to determine a user’s most recent log in?

history
shell
login
last

A

last

159
Q

The /etc/passwd file contains encrypted user password information. True or False?

True or False?

True
False

A

False

160
Q

Which of the following files contains group IDs?

/etc/passwd
/etc/usr
/etc/shadow
/etc/group

A

/etc/group

161
Q

Which command allows you to view or change some of the default values used by the useradd command?

useradd -D
useradd -r
modvalue
useradd -f

A

useradd -D

162
Q

Which of the following commands, run as root, will prevent the user jane from logging in?

usermod -d jane
usermod -D jane
usermod -L jane
usermod -l jane

A

usermod -L jane

163
Q

Which of the following commands set “other” permissions on file to r-x?

chmod o-r-w file
chmod o+rx file
chmod o=rx file
chmod o=r+x file

A

chmod o=rx file

164
Q

Which of the following commands sets “other” permissions on file to r-x?

chmod 775 file
chmod 776 file
chmod 777 file
chmod 774 file

A

chmod 775 file

165
Q

Only one set (user, group, other) of permission can be changed at once using the symbolic method.

True or False?

True
False

A

False

166
Q

Which of the following are methods for setting permissions using the chmod command?

(choose two)

letter
primary
symbolic
octal

A

symbolic
octal

167
Q

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

True or False?

True
False

A

True

168
Q

The user sysadmin will be able to read a file because they own it.

True or False?

True
False

A

False

169
Q

The user sysadmin will be able to change the permissions of a file because they own it.

True or False?

True
False

A

True

170
Q

Octal notation uses the following values for the permissions granted:

r = 7, w = 5, x = 0
r = 3, w = 2, x = 1
r = 4, w = 2, x = 0
r = 4, w = 2, x = 1

A

r = 4, w = 2, x = 1

171
Q

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

750
775
666
777

A

777

172
Q

A user cannot delete a file if they do not own it.

True or False?

True
False

A

False

173
Q

The “execute” permission on a directory allows you to:

(choose three)

Along with write permission to successfully delete the directory
Along with read permission to successfully perform ls -l
Along with write permission to successfully create new files
Change to that directory or use it as part of a path

A

Along with read permission to successfully perform ls -l
Along with write permission to successfully create new files
Change to that directory or use it as part of a path

174
Q

The “execute” permission on a file allows you to:

Move the file to a new directory
Delete the file
Run the file as a script
This permission isn’t meaningful for text files.

A

Run the file as a script

175
Q

The chgrp command can be used on a file by:

A user that belongs to the files current group
Only the file owner
The file owner and root
Only root

A

The file owner and root

176
Q

The chown command can be used to change the user owner on a file by:

The file owner
Only root
The file owner and root
A user that belongs to the files current group

A

Only root

177
Q

The chmod command can be used on a file by:

Only root
A user that belongs to the files current group
The file owner
The file owner and root

A

The file owner and root

178
Q

The “execute” permission is never set on files by default.

True or False?

True
False

A

False

179
Q

Which of the following chown commands will change the myFile user ownership to the user sam and the group ownership to administrators?

(choose two)

chown sam administrators myFile
chown sam.administrators myFile
chown sam:administrators myFile
chown sam+administrators myFile

A

chown sam.administrators myFile
chown sam:administrators myFile

180
Q

The chown command permits changing group ownership done by root only.

True or False?

True
False

A

False

181
Q

The user owner of a file will always have the same or higher permissions as “other”.

True or False?

True
False

A

False

182
Q

Which of the following commands will list hidden files as well as their ownership?

ls -la
ls -l
ls -a
ls -z

A

ls -la