Question: QUESTION 1 Which command would extract the files from an archive named homework-archive.tgz? a. rm homework-archive.tgz b. tar xzf homework-archive.tgz c. tar -czf homework-archive.tgz *

QUESTION 1

Which command would extract the files from an archive named homework-archive.tgz?

a.

rm homework-archive.tgz

b.

tar xzf homework-archive.tgz

c.

tar -czf homework-archive.tgz *

d.

tar -tzf homework-archive.tgz

QUESTION 2

Which commands will get you out of the vi text editor without saving your changes?

a.

/quit

b.

ESC :nc

c.

ESC :z

d.

ESC :q!

QUESTION 3

A file named "homework" had the following permissions: -rwxr--r--

Which command could have been typed to change the permissions to this: --wx-w---x

a.

chmod 465 homework

b.

chmod 321 homework

c.

chmod a-r homework

d.

chomd g-r homework

QUESTION 4

You have a file named "thesis.txt" and you want to make a copy of it before doing some heavy editing. What command would you type to create a copy named "thesis-backup.txt"?

a.

mv thesis.txt thesis-backup.txt

b.

cp thesis.txt thesis-backup.txt

c.

cp thesis-backup.txt thesis.txt

d.

copy thesis.txt thesis-backup.txt

QUESTION 5

Which command would you type to view all connected filesystems in Unix?

a.ls /

b.

ps axm

c.

lm -a

d.

mount

QUESTION 6

Who developed the GNU Public License?

a.

Richard Stallman

b.

Linus Torvalds

c.

Eric Raymond

d.

John Hall

QUESTION 7

You have a file named "students.txt" that lists the names of all the students in the schoolsystem. You want to count how many of the names (either first or last) contain Franklin.

Which command would do this for you?

a.

wc -l -s Franklin student.txt

b.

grep -c Franklin students.txt

c.

wc -l students.txt | grep Franklin

d.

grep students.txt Franklin | count -l

QUESTION 8

Which command would you type to view the detailed contents of a directory, including file permssions?

a.

ls -l

b.

ls

c.

dir -a

d.

ld -p

QUESTION 9

Match the term to the definition for various help and documentation systems in Unix.

-

1.man

-

2.apropos

- 3.

whatis

- 4.

info

A.

Used to display a very brief description of a Unix command.

B.

An alternate form of documentation, sometimes used by the GNU utilities.

C.

Traditional Unix documentation. Considered to be the formal documentation, often very detailed.

D.

Used when you don't know the exact name of the Unix command. With this utility, you can quickly search the list of Unix manuals for a particular search term.

QUESTION 10

If your current working directory is /var/log, which of the following commands would bring you up to the /var directory? (there might be more than one right answer)

a.

cd ..

b.

cd var/

c.

cd /var

d.

cd ./

QUESTION 11

Some programs take a long time to finish when run, so you would like to run the command in the background so you can continue to work in your terminal until it finishes.

For example, if you are using the "cc" compiler to compile a very complex program that might take an hour to finish compiling, the command might be "cc big-program.c"

How would you run that program and have it run in the background?

a.

top cc big-program.c

b.

cc big-program.c &

c.

%1 cc big-program.c

d.

cc big-program.c !

QUESTION 12

You can type the "ps ax" command to see information about running programs. You want to capture the output of this command to a file named "running-programs.txt". How would you do that?

a.

stdout ps ax running-programs.txt

b.

ps ax | running-programs.txt

c.

ps ax > running-programs.txt

d.

ps ax ; running-programs.txt

QUESTION 13

When using the less command to view a text file, which key can you press to begin a search?

a.

/

b.

s

c.

=

d.

The spacebar

QUESTION 14

Which directory holds most of the system configuration files in Unix?

a.

/etc

b.

/var

c.

/root

d.

/bin

QUESTION 15

What is the difference between "rm *.html" and "rm * .html"? (the second one has a space between the * and the .html)

a.

They both do the same thing.

b.

Both delete every file in the directory that have filenames that end in .html, but the second one will also delete subdirectories.

c.rm *.html will delete all files that have .html as the end of the file name.

rm * .html will delete all files, and also try to delete a file named only .html

d.The first one will work correctly, but the second one is an invalid command.

QUESTION 16

Which command below accomplishes the roughly same task as the following command? ls /usr/bin/*e

a.

ls /usr/bin | grep 'e$'

b.

grep e$ /usr/bin

c.

ls /usr/bin | grep 'e^'

d.

egrep /e/ /usr/bin

QUESTION 17

Which word below is matched by this search?

.grep '^..m.r$'

a.

walker

b.

tamer

c.

amber

d. tomorrow

QUESTION 18

You want to search a file named govern.txt and return all lines that contain either the word COLLINS or the word PINGREE. Which command would work?

a.

grep -E 'COLLINS|PINGREE' govern.txt

b.

cat govern.txt | grep COLLINS | grep PINGREE

c.

grep COLLINS PINGREE < govern.txt

d.

grep ^N$ govern.txt

QUESTION 19

If you have a file named phone-numbers.txt that looks like this:

207-568-6723 617-277-2343 207-822-9645 603-314-5892 800-233-3413

Doing "sort phone-numbers.txt" will end up sorting by area code.

What if you want to sort by the last 4 numbers?

a.

cat -r phone-numbers.txt | sort -rn

b.

sort -t\- -k3 phone-numbers.txt

c.

sort -n phone-numbers.txt

d.

sort [[:allnum:]]$ phone-numbers.txt

QUESTION 20

You have a file named employees.txt with content that you want to convert to all uppercase. Which command would do that for you?

a.

tr [:lower:] [:upper:] < employees.txt

b.

sed s/a-z/A-Z/g employees.txt

c.

tr az AZ < employees.txt

d.

grep [a-z] [A-Z] employees.txt

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!