Linux and Bash for Data Engineering Week3

.docx

School

Grand Rapids Community College *

*We aren’t endorsed by this school

Course

MISC

Subject

Computer Science

Date

Dec 6, 2023

Type

docx

Pages

3

Uploaded by ConstableWildcatMaster401 on coursehero.com

Congratulations! You passed! Grade received 100% Latest Submission Grade 100% To pass 80% or higher Go to next item 1. Question 1 What is an example of a control flow in Bash? 1 / 1 point A for loop. Creating a variable. Making a script. Correct You got it! A for loop allows for iteration tasks, such as moving a list of files to a new location. 2. Question 2 What happens when this command runs? false || echo "hi" 1 / 1 point An error prints to stdout. Nothing prints out. The word "hi" prints to stdout. Correct You got it! The || operator serves as an OR statement. 3. Question 3 What happens when this command runs? false && echo "hi" 1 / 1 point The word "hi" prints to stdout. An error prints to stdout. Nothing prints out. Correct You got it! The && operator is an AND statement. 4. Question 4 Why would a data scientist need to truncate a large file before bringing it into a popular data science library like Pandas? 1 / 1 point It improves the accuracy of a prediction. To remove null values. To convert the data to a small data problem. Correct You got it! Many popular data science libraries are designed to work around smaller data sets and it may not be possible to open a larger file in them.
5. Question 5 What would this statement return? printf "hello\nworld\n" | grep hello 1 / 1 point Nothing. hello world hello Correct You got it! Each line of the print statement is evaluated by grep and the match is returned. 6. Question 6 What is a key difference between find and locate ? 1 / 1 point The locate command uses metadata to search the filesystem. They are both the same command. The find command uses metadata to search the filesystem. Correct You got it! The locate command searches a database that of a historical snapshot of the state of the filesystem. 7. Question 7 What would this command do? find . -perm /+x ! -name '.*' -type f 1 / 1 point Find all files with the word x in them. Find all directories in the search path Find all executable non-invisible files. Correct You got it! The -perm flag allows for a search of UNIX permissions. 8. Question 8 What would be the output of this command? printf "apple\npear\npeach\n" | grep -v pear 1 / 1 point apple peach pear apple pear peach Correct You got it! The grep -v flag is a negative search. 9. Question 9 What reason could a data scientist have for using the following command?
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help