Examen hoofdstuk 9-16 meerkeuze Flashcards

1
Q

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

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

test $USERS –eq 5

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
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.
/tmp/foo will be removed if it exists
process_data will never be run
If a file called /tmp/foo exists, process_data won’t be run
process_data will be called at most once
A

If a file called /tmp/foo exists, process_data won’t be run

process_data will be called at most once

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

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

    fanout
    if
    branch
    case
    test
A

case

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

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

If i 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
This runs the command stored in variable i
This will return the value of the next argument to the script
A

1 will be added to the i variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
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 | $USERS > 5
    test /tmp/foo –d –o $USERS -gt 5
    test /tmp/foo || $USERS > 5
    test –d /tmp/foo –o $USERS –gt 5
    test –f /tmp/foo –o $USERS –ge 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
6
Q

A division of a hard drive may be referred to as a _______ .
(choose two)

partition
label
slice
block
A

partition

slice

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
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
8
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
9
Q

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

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

/dev/hda

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

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

AMD
DVI
VGA
HDA
A

DVI

VGA

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

A command that will continuously update statistics about running processes:

top
tail
bottom
head
A

top

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

The following are valid Linux option styles:
(choose three)

Traditional Unix with a single dash (-)
BSD Unix without a dash
DOS slash (/)
GNU long options with two dashes (–)
A

Traditional Unix with a single dash (-)
BSD Unix without a dash
GNU long options with two dashes (–)

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

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

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

/proc/cmdline

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

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

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

/etc/sysctl.conf

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

To get a list of all packages installed on a system using RPM Package Management you can execute:

rpm -qa
rpm -ql
rpm -qf
rpm -qi
A

rpm -qa

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

Which of the following would be considered a host?

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

A printer attached to the network via an IP address

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

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

-t
-n
–name
-r
A

-n

18
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

19
Q

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

True
False
A

False

20
Q

Which files contain user account information?
(choose two)

/etc/shadow
/etc/group
/etc/passwd
A

/etc/shadow

/etc/passwd

21
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

22
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

23
Q

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

who
w
id
uptime
A

w

uptime

24
Q

The /etc/shadow file contains plain-text passwords.
True or False?

True
False
A

False

25
Q

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

getent
uptime
getpasswd
uppasswd
A

getent

26
Q

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

login
last
history
shell
A

last

27
Q

Which of the following files contains encrypted user password information?

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

/etc/shadow

28
Q

Which of the following files contains user IDs?

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

/etc/passwd

29
Q

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

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

/etc/group

30
Q

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

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

usermod -L bob

31
Q

The chmod command can be used on a file by:

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

The file owner and root

32
Q

Which option for the chown command can be used to change the owner of a directory and all the files and directories below it?

- f
- R
- a
- r
A

-R

33
Q

The chown command will only accept one file at a time as an argument.
True or False?

True
False
A

False

34
Q

The “execute” permission is never set on files by default.
True or False?

True
False
A

True

35
Q

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

True
False
A

False

36
Q

A source and a hard link must be part of the same filesystem.
True or False?

True
False
A

True

37
Q

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

True
False
A

True

38
Q

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

True
False
A

False

39
Q

Which of the following commands would create a hard link, link to file?

ln link file
ln -s link file
ln file link
ln -s file link
A

ln file link

40
Q

Which of the following commands would create a symbolic link, link to file?

ln link file
ln -s file link
ln file link
ln -s link file
A

ln -s file link