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

Question 1 (1 point) How do you symbolically link /usr/games/starwar with a file

ID: 662969 • Letter: Q

Question

Question 1 (1 point)

How do you symbolically link /usr/games/starwar with a file of the same name in your current directory?

Question 1 options:

Save

Question 2 (1 point)

In the following command line
wc >file1 < file2

Question 2 options:

Save

Question 3 (1 point)

How do you show lines 5 to 10 of file foo?

Question 3 options:

tail -n +5 foo | head

tail -n +10 foo | head -5

head foo | tail -n +5

head -5 foo | tail -n +10

Save

Question 4 (1 point)

How do you know how many different users are logging into the system?

Question 4 options:

who | uniq | sort | wc -l | cut -d' ' -f1

who | cut -d' ' -f1 |sort | uniq | wc -l

who | uniq | sort | cut -d' ' -f1 | wc -l

who | wc -l | sort | cut -d' ' -f1

Save

Question 5 (1 point)

Which one will you use to make sure that a process is killed?

Question 5 options:

Save

Question 6 (1 point)

How to run a command in the background

Question 6 options:

Save

Question 7 (1 point)

What can be put into the first line of your script to make sure a script will use the Bourne shell?

Question 7 options:

Save

Question 8 (1 point)

Which special parameter indicates the name of the script?

Question 8 options:

Save

Question 9 (1 point)

When you look for a pattern in files ignoring case which one will you use?

Question 9 options:

Save

Question 10 (1 point)

Frame regular expression to match lines containing Mcgee Macgee mcghee magee.

Question 10 options:

Save

Question 11 (1 point)

Which of the following represents an absolute path?

Question 11 options:

Save

Question 12 (1 point)

Which of these commands will set the permissions on file textfile to read and write for the owner, read for the group, and nothing for everyone else?

Question 12 options:

Save

Question 13 (1 point)

When you use the ln -s command, which of the following occurs?

Question 13 options:

Save

Question 14 (1 point)

Which command will print the contents of all files in the current directory whose names start with the character 'a' and end with a period ('.') followed by any two characters followed by a number?

Question 14 options:

Save

Question 15 (1 point)

Which of these situations would cause an error message to be printed after typing the command my_script on the command line, assuming that my_script is a bash script?

Question 15 options:

Save

Question 16 (1 point)

In a bash script, how does one indicate the beginning and end of a block of statements in a while loop?

Question 16 options:

Save

Question 17 (1 point)

To compare equality for two integers, val1 and val2, using test command (assuming bash script), you use

Question 17 options:

Save

Question 18 (1 point)

What is the default list upon which a for loop operates in a bash script (i.e. a script contains for x rather than for x in y)?

Question 18 options:

Save

Question 19 (1 point)

Which of these is not a situation in which you could use regular expressions?

Question 19 options:

Save

Question 20 (1 point)

Which of the following is not a file stream opened automatically in a UNIX program?

Question 20 options:

Save

Question 21 (1 point)

In UNIX, a process refers to what?

Question 21 options:

Save

Question 22 (1 point)

System administration tasks must generally be performed by which username?

Question 22 options:

Save

Question 23 (1 point)

How can you append the output of a command to a file?

Question 23 options:

Save

Question 24 (1 point)

If umask is set to 022, what is the default setting for a newly created directory?

Question 24 options:

Save

Question 25 (1 point)

Which of the following command can extract from a tar file called game.tar

Question 25 options:

Save

Question 26 (1 point)

The command grep computer /etc/* | more will show all files with the search word

Question 26 options:

Save

Question 27 (1 point)

Assuming file1 contains one column of data and file2 contains another column of data. To combine the data in file1 and file2 side by side and save the data in file3, we can use

Question 27 options:

paste file1 file2 > file3

Save

Question 28 (1 point)

what is missing from the unix command for looking for rose garden in all files in ~: grep rose garden ~/* | more

Question 28 options:

Save

Question 29 (1 point)

The command
cut -f2 -d: data > temp
will write the second ___ of data table to temp

Question 29 options:

Save

Question 30 (1 point)

Which of the following command will find all the files named test in /

Question 30 options:

1) ln . /usr/games/starwar 2) ln /usr/games/starwar . 3) ln -s . /usr/games/starwar 4) ln -s /usr/games/starwar .

Explanation / Answer

Question 1:

The symbolic link is a a file pointing to another file in current directory.

Symlink syntax: ln -s /path/to/file_or_dir/ linkname

Thus, the correct option is 3) ln -s . /usr/games/starwar

Question 2:

In the command line, file1 and file2 are aruments for the wc command. wc >file1 < file2 represents the input for wc will come from keyboard.

Thus, the correct option is 3) Input for wc will come from keyboard

Question 3: Correct option is 4) head -5 foo | tail -n +10

Question 4: Correct option is 4) who | wc -l | sort | cut -d' ' -f1

Question 5:The kill command kills process by process identification number 9.

Thus, the correct option is 1) kill -9

Question 6: Run a command in the background is simply put an (&) ampersand symbol at the end of the commandk.

For example: file.sorted &

Thus, the correct option is 1) put an '&' at the end of the command.

Question 7: Correct option is 4) $/bin/sh

Question 8: $0 indicates the name of the script itself.

Thus, the correct option is 4) $0

Question 9: Correct option is 2) grep-i

Question 10: Correct option is 1) [Mm]a?c?gh*ee

Question 11:  Correct option is 2) /bin/file1

Question 12:  Correct option is 2) chmod 640 textfile

Question 13:  Correct option is 1) a file is created that points to an existing file

Question 14: Correct option is 1) ls a*.??[0-9]

Question 15: Correct option is 3) both a) and b)

Question 16: Correct option is 4) with do and done

Question 17: Correct option is 3) [ val1 = val2 ]

Question 18: Correct option is 3) the list of arguments to the script

Question 19: Correct option is 1) filtering of email coming from a particular internet domain name

Question 20: Correct option is 2) standard terminal

Question 21: Correct option is 3) an executing instance of a program

Question 22: Correct option is 2) root

Question 23: Correct option is 4) command >> file

Question 24: Correct option is 2) Owner has read, write, execute rights, all the others can write.

Question 25: Correct option is 4) tar zvf game.tar

Question 26: Correct option is 4) computer

Question 27: Correct option is 1) cat file1 file2 > file3

Question 28: Correct option is 4) nothing is missing

Question 29: Correct option is 4) letter

Question 30: Correct option is 3) find / -name test -print

Correct option is