Test Questions Flashcards

Linux and Open Source OS/ VM OS

1
Q

True or False? You’ve typed rmdir junk to delete the junk directory, but this command has failed because junk contains word processing files. To do the job, you type rm -r junk.

A

True

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

If you were a LInux system’s administrator and wanted to see who is currently logged into the computer and what programs they are currently running, you can type the ____ command.

a. w
b. whoami
c. uid
d. u

A

w

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

Which of the following redirection operators appends a program’s standard output to an existing filem without overwriting that file’s original contents?

a.&raquo_space;
b. |
c. 2>
d. &>
e. >

A

> >

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

Which file now stores kusers passwords in the Linux OS?

a. /etc/passwd
b. /etc/groups
c. /etc/shadow
d. /etc/user

A

/etc/shadow

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

True or False: The regular expression

Linu[&c.circ;x].*lds

matches the string, Linux Torvalds.

A

True

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

If you wanted to run/execute a script called

my-script

, what could you tupe in the Linux terminal shell to accomplish this?

a. grep a+x ./myscript
b. apt-get a+x ./myscript
c. chmod a+x ./my-script
d. su a+x myscript

A

chmod a+x ./my-script

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

Which single keyboard character represents any single character except in a new line in a regular expression in Linux?

a. .
b. !
c. $
d. #

A

.

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

Which of the following commands would you type to rename a file called newfile.txt to afile.txt?

a. mv newfile.txt afile.txt
b. touch newfile.txt afile.txt
c. rn newfile.txt afile.txt
d. cp newfile.txt afile.txt

A

mv newfile.txt afile.txt

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

You work as a Network Administrator for a company, and they have a Linux based network. You have created a script named if.cgi. You want to provide the following permissions on it:

rwsr-sr–

a. chmod 6754
b. chmod 2754
c. chmod 4754
d. chmod 7754

A

chmod 6754

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

Which of the following are the two major Linux package management systems?

a. RPM
b. BASH
c. DPKG
d. TAR

A

RPM & DPKG

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

Using the image below, what does the x character represent?

roman x 1025:100::/home/roman:/bin/bash

a. An un-encrypted password stored in the /etc/shadow file.
b. An encrypted password stored in the /etc/passwd file.
c. An encrypted password stored in the /etc/shadow file.
d. An account with no password set.

A

An encrypted password stored in the /etc/shadow file.

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

You want to copy a directory, MyFiles, to a USB flash drive that uses the FAT filesystem. The contents of MyFiles are as follows:

$ |s -| MyFiles/
total 276
-rw-r–r– 1 jen users 129840 Nov 8 15:13 contract.odt
-rw-r–r– 1 rod users 42667 Nov 8 15:12 outline.pdf
-rw-r–r– 1 sam users 105979 Nov 8 15:12 Outline.PDF

The USB flash drive is mounted at /media/usb, and so you type cp -a MyFiles/ /media/usb. What problem will occur when you attempt to copy these files?

a. One file will be missing on the USB flash drive.
b. Everything will be fine; the command will work correctly.
c. One file name will be changed during the copy.
d. The command will fail because it tries to create links.
e. The MyFiles directory will be copied, but none of its files will be copied.

A

One file will be missing on the USB flash drive.

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

Which of the following Linux commands will print lines from the file world.txt that contain matches to “changes” and “changed”?

a. grep change[ds] world.txt
b. tar change[d-s] world.txt
c. find “change’d|s” world.txt
d. cat world.txt changes changed
e. find change[&c.circ;ds] world.txt

A

grep change[ds] world.txt

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

To have a script send an email automatically, which command would you use to do this?

a. mail
b. sed
c. awk
d. email

A

mail

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

What could you tupe in a Linux command line terminal shell to see a list of all process IDs (PID) on your computer?

a. process
b. ps
c. get pid
d. get rid

A

ps

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

Which command would reveal the total RAM statistics about your Linux system?

a. swap
b. ram
c. mem
d. free

A

free

17
Q

Which of the following keyboard strokes would you use to connect two or more commands in Linux?

a. >
b.&raquo_space;
c. |
d. +

A

|

18
Q

True or False: Linux stores information on groups in the /etc/groups file.

A

False

19
Q

Which command would you type if you wanted to display your username from a Linux command line terminal shell?

a. help
b. uid
c. whereami
d. whoami

A

whoami