Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

QUESTION 1 You have finished your thesis, and want to set the permissions so tha

ID: 3811972 • Letter: Q

Question

QUESTION 1

You have finished your thesis, and want to set the permissions so that it is hard to accidentally delete or overwrite the file.

Normally, if you were to type "rm Thesis.txt", it would just delete it without asking. Or, if you moved a file with the same name into the same directory as your original Thesis.txt, it would overwrite it with the new version.

Which command would change the permissions for a file called Thesis.txt so that you are less likely to delete or overwrite it by accident?

chmod o-rwx Thesis.txt

chmod a+rwx Thesis.txt

chmod a+w Thesis.txt

chmod a-w Thesis.txt

QUESTION 2

You have a file named Homework with the following permissions:

-rw-r--r-- 1 fsmith staff 12 Feb 20 14:08 Homework

Which command would you type to make sure that you were the only one with permission to view the contents of the file? (permissions should look like this when done)

-rw------- 1 fsmith staff 12 Feb 20 14:08 Homework

chmod 400 Homework

chmod 600 Homework

chmod rw Homework

chmod 777 Homework

QUESTION 3

Match the name of the directory to the description

/etc

/usr/bin

/

/var

The directory that holds most of the computer programs or applications

The directory that holds most of the system configuration files

The root, or top of the Unix directory tree. All directories are sub-directories of this.

This directory holds data that is often changing, like database files, incoming user email, etc.

QUESTION 4

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

Which command could have been typed to change the permissions to this: -r--r-----

chmod a-r homework

chomd g-r homework

chmod 440 homework

chmod 465 homework

  

QUESTION 5

Which command would you type to delete a file named "Bad-Homework.txt"?

dl Bad-Homework.txt

rm Bad-Homework.txt

rm bad-homework.txt

ln bad-homework.txt

  

QUESTION 6

In Unix, what does the .. (or dot dot) directory specify?

The last directory visited

The current working directory

The working directory's parent directory

The top of the directory tree

  

QUESTION 7

If you have been wandering around the Unix filesystem, which command could you type to bring you back to your home directory?

ls

pwd

cd

home

QUESTION 8

What key or keys can you press to interrupt (politely ask to terminate) a program that is running in your terminal?

Delete-Enter

Ctrl-c

ESC

X

QUESTION 9

There might be more than one version of a program on a Unix system, and you might not know which one is executed when you type the name of the command. What would you type to identify the exact location of a program named "lsof"?

id lsof

which lsof

where lsof

uniq lsof

QUESTION 10

What is the difference between > and | ? Or what is the difference between redirection and the pipe?

They are both the same, but pipelines were added by Linux as an alternative symbol.

The redirection operator connects a command with a file while the pipeline operator connects the output of one command with the input of a second command.

The redirection operator connects a command can be used by regular users on a system, while pipelines can only be used by administrators.

The redirection operator connects a command with a file while the pipeline operator reads input from the keyboard.

QUESTION 11

You have a bunch of text files in your home directory, and you are trying to find which ones contain the name "Backman". You are not certain if the name is all lowercase, has only the first letter capitalized, or is all caps.

What command would you type to search within all the files in your current working directory for the name "Backman", and ignore case?

grep * [BACKMAN]

grep -c * Backman

grep -i backman *

find -i * backman

QUESTION 12

What is the traditional name of the superuser or most powerful account in Unix?

manager

domain administrator

supervisor

root

QUESTION 13

How would you view the last 50 lines of a long text file named "Homer.txt"?

more -c 50 Homer.txt

tail Homer.txt | wc -l 50

grep 50 Homer.txt

tail -n 50 Homer.txt

  

QUESTION 14

Which command would delete all files in your current directory that have a filename that is exactly three letters long which ends with the letter t?

rm ??t

rm ???t

rm [3]t

rm -r *t*

  

QUESTION 15

In the vi text editor, which key sequence will delete the current line while in command mode?

x

dl

dd

ZZ

QUESTION 16

In the vi text editor, which key sequence will bring you to the end of the current line while in command mode?

L

$

l

e

  

QUESTION 17

In the vi text editor, which sequence of commands will copy the current line and past a copy of it below? (go ahead and try these to find out!)

"c" then "v"

"yy" then "p"

"C" then "p"

"D" then "p"

QUESTION 18

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

ESC :z

/quit

ESC :nc

ESC :q!

QUESTION 19

On debian-based systems, which command will list currently installed software packages?

apt-get -l

dpkg -l

list-packages

pkg --list

QUESTION 20

Match the package manager to the operating system/distribution

rpm/yum

deb/apt-get

pkg

rpm/zypper

openSUSE

FreeBSD 10

Redhat

Ubuntu

a.

chmod o-rwx Thesis.txt

b.

chmod a+rwx Thesis.txt

c.

chmod a+w Thesis.txt

d.

chmod a-w Thesis.txt

Explanation / Answer

3. /etc The directory that holds most of the system configuration files

/var This directory holds data that is often changing, like database files, incoming user email, etc.

/user/bin The directory that holds most of the computer programs or applications.

/ The root, or top of the Unix directory tree. All directories are sub-directories of this.

5. b , rm file_name

6. c, The double period ".." means parent of the current working directory.

7. c

8. b

10. b

12. d

13. d

14. a , ?? represents 3 characters ending with letter t.

15. c

16. b

17. b

18. d

19. b

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote