Question

In: Computer Science

1. You have just finished a 25-page paper that you have written using Emacs.The file containing...

1. You have just finished a 25-page paper that you have written using Emacs.The file containing the paper is called /assignments/data_sources.After your instructor has briefly looked at the paper, she recommends that you change all instances of the ref- erence “data is” to “data are” before you submit it.Which of the following com- mands can you use to locate these references in the file for a quick assessment of how much you have to change?

a. find - i 'data is' /assignments/data_sources

b. test /assignments/data_sources "data is"

c. grep "data is" /assignments/data_sources

d. scan -t data is /assignments/data_sources

2. You are interested in determining the number of words in your /assignments/ data_sources file mentioned in Question 1.Which of the following commands should you use?

a. wc -w /assignments/data_sources

b. wc -m /assignments/data_sources

c. counter /assignments/data_sources

d. counter -c /assignments/data_sources

3. Which of the following are examples of manipulation and transformation commands? (Choose all that apply.)

a. sed

b. pr

c. join

d. Paste

4. Which of the following is true of the pipe operator? (Choose all that apply.)

a. Only one pipe operator can be used on a single command line.

b. It is used to perform division on the results of a numerical command operator.

c. It is used instead of the colon (:) for entering multiple commands

d. It redirects the output of one command to the input of another command.

5. Because the data was formatted the same in two inventory files, you decided to com- bine their contents into one file. Now you want to determine if there are duplicate entries on consecutive lines in the new file.Which of the following commands enables you to find the duplicate entries?

a. dup

b. pr

c. uniq

d. Cat

6. Your friend is using the command comm entryfile, but is getting an error message. What is the problem? (Choose all that apply.)

a. entryfile contains only numbers, but the comm command must be used on a file with text.

b. It is necessary to use either the -m or -t option with the comm command.

c. entryfile is too long, because the comm command can only be used on a file under

100 KB in size.

d. It is necessary to specify two files when you use the comm command.

7. Your boss is trying to import the customers file into her spreadsheet program, but the data goes into the spreadsheet incorrectly.This is because the fields are separated by dashes (-) and the spreadsheet program requires the fields to be separated by colons (:).Which of the following commands can you use to convert the

customers file?

a. replace - : customers

b. tr "-" ":" < customers

c. sed %- %: > customers

d. cat -r -/: customers

8. How can you link multiple files to manipulate the data in those files?

a. with a linker

b. with a project field

c. with a common or key field

d. with an operator entry

9. While in the Bash shell, you have written a simple script file and now want to execute the script.Which of the following commands enables you to run the script?

a. sh

b. go

c. ex

d. !!

10. You are using the grep command, but it is only searching through files in your imme- diate home directory.What option enables you to search through subdirectories below your home directory?

a. -s

b. --sub

c. -c

d. -r

11. Your software has a bug in that it enables you to create a vendors file in which there are duplicate entries of vendors.Which of the following methods enables you to remove the duplicate vendors in this text file?

a. Sortthefileandthenusethecommcommandtoremovetheduplicates,inputtingthe result into the same file.

b. Sort the file in reverse order and then use the dump command to remove the duplicates.

c. Sort the file and then use the uniq command to remove the duplicates, inputting the result in a new file.

d. Reverse sort the file, use the join command, and output the results back into the vendors file.

12. Each time you list the files in your home directory, the output scrolls by so fast you can’t read it.Which of the following enables you to view the output one screen at a time?

a. cat -pause

b. ls -l | more

c. window ls -a

d. dir < display

13. You are creating a file to send over the Internet via a satellite connection that only allows you to send files under 250 KB.Which of the following commands enables you to determine the number of bytes in the file before you try to send it?

a. cat -s

b. tr -b

c. counter -k

d. wc -c

14. In the command sed -f fixit notes > instructions, what is “fixit”?

a. a script file

b. an operator

c. a function

d. a formatting interpreter

15. When you design a record layout, you should do which of the following? (Choose all that apply.)

a. identify each field by data type

b. plan to delimit fields using a dash

c. identify each field by name

d. store only fields relevant to the record’s purpose

16. What sed command option enables you to append new text to a file?

a. p

b. -n

c. a\

d. |add

17. Your boss has two salary scale files, salary and salary1, and wants to compare their contents side by side to see if there are any differences in the files.Which of the fol- lowing commands should he use?

a. diff -S salary > salary1

b. comm salary salary1

c. uniq salary < salary1

d. sed --comp salary salary1

18. When you use the pr command how can you limit the output to only a screen full of text to view. (Choose all that apply.)

a. Maximize your terminal window to hold 24 lines.

b. Pipe the output into more.

c. Use the -l 23 option.

d. Pipe the less command into the more command.

19. When you use the Awk printf capability, what does the dollar sign ($) represent?

a. a field size limit

b. a multiplier

c. a command to put text in lowercase

d. a data field

20. Your boss is trying to delete the word “difficult” as it appears in a text file containing his speech about motivation.The name of the file is motivate.When he decides to use the tr command to delete this word, it instead deletes characters throughout the text.Which of the following commands is he likely to have used?

a. tr -d "difficult" < motivate

b. tr difficult motivate

c. tr -o 'difficult' > motivate

d. tr --eliminate difficult motivate

21. When you enter the command grep Linux /info/Linux_ features | head, what is the maximum number of lines that will be displayed?

a. 24 lines

b. 23 lines

c. 15 lines

d. 10 lines

22. List four examples of selection commands.

23. What is the general format for using the pipe operator?

24. Briefly explain what you can accomplish with the sed command.

25. You want to create a file of your friends’ and relatives’ names, addresses, telephone numbers, and other information.When you mention this to your sister-in-law, she recommends having separate fields for the first, middle, and last names. Briefly explain why this is a good idea.

Solutions

Expert Solution

1. c grep "data is" /assignments/data_sources

Grep searches for lines containing a specified pattern and, by default

3. All of the options as all are manipulative and transformative in some form

join - join lines of two files on a common field

sed - stream editor for filtering and transforming text

pr - convert text files for printing

paste - merge lines of files

4.The pipe operator ( | ) redirects the output of one command to the input of another command.It may consist of multiple commands.

• Multiple pipe operators can be used on a single command line. Hence, the option (a) is incorrect.

• There is no division on the results of a numerical command operator. Hence, the option (b) is incorrect.

• Even multiple commands the operator (|) is not change. Hence, the option (c) is incorrect.

5. C uniq

uniq - report or omit repeated lines

6 d- It is necessary to specify two files when you use the comm command.

The comm command compares lines common to the two sorted files.

It shows an error if it operates with a single file.

Thus, it is necessary to specify two files when you use the comm command.

8- c-Link multiple files to manipulate the data in those files using with a common or key field.

• With a linker is not a valid command. So, option (a) is incorrect.

• With a project field, link multiple files to manipulate the data in those files is not possible. Hence, the option (b) is incorrect.

• With an operator entry, link multiple files to manipulate the data in those files is not possible. Hence, the option (d) is incorrect.


Related Solutions

Your written assignment for this module should be a 1-2 page paper (not including title page...
Your written assignment for this module should be a 1-2 page paper (not including title page and reference page) that describes the following: What are the different types of immunities and give an example of each Describe how stress impacts the immunity of a person You should include a minimum of 3 scholarly references (suggestion on using SkyScape). Include a title page, in-text citations, and a reference page in APA format. Submit your completed assignment by following the directions linked...
Your written assignment for this module should be a 1-2 page paper (not including title page...
Your written assignment for this module should be a 1-2 page paper (not including title page and reference page) that describes the following: What are the different types of immunities and give an example of each Describe how stress impacts the immunity of a person You should include a minimum of 3 scholarly references. Include a title page, in-text citations, and a reference page in APA format
Your written assignment for this module should be a 1-2 page paper (not including title page...
Your written assignment for this module should be a 1-2 page paper (not including title page and reference page) that describes the following: Describe what a fluid and electrolyte imbalance is and how this is important to the function of the body? Pick a fluid or electrolyte imbalance and describe how the patient would present, in addition to the treatment (nursing and expected medical)?
In a 3-page paper, written in APA format using proper spelling/grammar, research the topic of menopause...
In a 3-page paper, written in APA format using proper spelling/grammar, research the topic of menopause and address the following: Explain perimenopause, surgical menopause, stress menopause, and postmenopause. Describe the signs of menopause. Which other life changes (e.g., physical, psychosocial, and cognitive) may influence a women's experience during menopause? Which women are at the highest risk for osteoporosis? Describe the traditional and alternative therapies for the conditions associated with menopause. Suggest appropriate health, nutrition, and exercise guidelines for middle-aged and...
You just finished analyzing a capital investment that will produce equal annual cash flows of $25...
You just finished analyzing a capital investment that will produce equal annual cash flows of $25 million of over its 5-year life. The resulting NPV is $4 million and the profitability index is 1.05. You assumed a $30 million salvage value, $20 million above its adjusted tax basis, and a 35% marginal tax rate. What discount rate did you use to value this investment? please show steps, no excel.
You just finished analyzing a capital investment that will produce equal annual cash flows of $25...
You just finished analyzing a capital investment that will produce equal annual cash flows of $25 million of over its 5-year life. The resulting NPV is $8 million and the IRR is 15.13%. You assumed a $30 million salvage value, $20 million above its adjusted tax basis, and a 35% marginal tax rate. What discount rate did you use to value this investment? please show the answer step by step and do not use excel
I just finished this program where the program reads a text file of full names ,...
I just finished this program where the program reads a text file of full names , first and last name, and a zip code. It reads the items then stores the first name and last name and zipcodes as an objects and prints the items.   However, when i use my text file i get this error "Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1 " I notice this issue only happens when the names are...
Assume you have a WAV file containing an audio with noise. The audio was sampled with...
Assume you have a WAV file containing an audio with noise. The audio was sampled with a sampling frequency of 8ksamples/second. If you play the audio file, you will be able to notice that there is a small tune along with a strong noise. Design a digital filter using Matlab or Octave to remove the noise. Write the code showing all steps of designing a digital filter? Need help please
In studying an accounting course, Please write a 1-page paper describing the skills you have acquired...
In studying an accounting course, Please write a 1-page paper describing the skills you have acquired which are relevant to, and supportive of, your future career goals and objectives. Also consider the following: Was there any point where you thought you might want to drop that course or quit? Why? What made you change your mind? Where you were when you began this course—were you concerned about it? How do you feel now that it’s complete? Please include anything else...
You are an intern at a Big 4 accounting firm and have just finished your internship...
You are an intern at a Big 4 accounting firm and have just finished your internship training. You feel a little overwhelmed with all of the information from the training session, and you are wondering if you are qualified to perform work that is of high-enough quality to meet the firm’s and the profession’s standards. What if you miss something or forget to do something? What if it takes you too long to complete your tasks? What if you spend...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT