Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Add post

You must login to add post .

Add question

You must login to ask a question.

Login

Register Now

Welcome to Scholarsark.com! Your registration will grant you access to using more features of this platform. You can ask questions, make contributions or provide answers, view profiles of other users and lots more. Register now!

Linux-and-Bash-for-Data-Engineering Quizzes & Answers – Coursera

Diving into the world of data engineering requires a solid understanding of the foundational tools that drive analysis and insight. Linux and Bash scripting stand out as pivotal skills for managing data workflows and automating tasks.

Our latest blog post offers an in-depth look at Coursera’s quizzes and answers for the ‘Linux-and-Bash-for-DataEngineering‘ course, providing readers with a practical guide to mastering these essential tools. Stay tuned as we unravel the quizzes and their solutions to bolster your data engineering expertise.

Using Linux

Q1. What is a good definition of Linux?

  •  A type of hardware.
  •  A kernel.
  •  A free and open source operating system inspired by UNIX.

Q2. Why is it a good idea to use a cloud-based shell environment?

  •  A cloud-based shell is similar or identical to the deployment environment in that cloud.
  •  They always run a proprietary UNIX which is helpful for building cloud solutions.
  •  The cloud-shell runs on your laptop and can take advantage of power of your local machine.

Q3. What is an advantage of a hosted development like GitHub Codespaces?

  •  It maintains the software development with the latest tools for you.
  •  It is always faster.
  •  It is free.

Q4. What is a good use case of a shell pipeline?

  •  To perform complex operations on data.
  •  Writing a web service.
  •  Writing a mobile application.

Q5. What is an example of the output of a shell pipeline?

  •  A file.
  •  A shell pipeline cannot output.
  •  The windows operating system.

Q6. What is the difference between the > and | operators?

  •  The > operator directs the output of a command to a file. The | operator directs the output of a command to another command.
  •  The | operator directs the output of a command to a file. The > operator directs the output of a command to another command.
  •  Both operators do the same thing, which is direct output to a file.

Q7. To checkout a Git repo via SSH what files must the GitHub host have from the client?

  •  The Git server must have a copy of ~/.ssh/id_rsa from the client checking out the repository.
  •  You do not need to copy files to a server to use SSH-based checkout.
  •  The Git server must have a copy of ~/.ssh/id_pub from the client checking out the repository.

Q8. Describe a common reason for SSH tunneling.

  •  Developing locally from a server running remotely.
  •  Doing unencrypted communication on a local network.
  •  Creating a public chat server that doesn’t require authentication.

Q9. What file synchronization process commonly takes place using SSH?

  •  rsync
  •  mv
  •  rmdir

Q10. What is a common way to configure multiple ssh tunnels?

  •  By use of the ~/.ssh/config file.
  •  By use of the ~/.zshrc file.
  •  By use of the ~/.bashrc file.

 

Using Bash

Q1. Explain the purpose of the ~/.bashrc file.

  •  It is a Bash login shell that only runs at the start of a new login shell.
  •  It is a Bash logout shell that only runs when a shell exits.
  •  It is a Bash shell script that runs whenever Bash is started interactively.

Q2. What is the purpose of the ~/.zshrc file?

  •  It is a ZSH login shell that only runs at the start of a new login shell.
  •  It is a ZSH logout shell that only runs when a shell exits.
  •  It is a ZSH shell script that runs whenever Bash is started interactively.

Q3. What shell example creates a shell variable to the current shell only.

  •  FRUIT=”cherry”
  •  echo $FRUIT
  •  export FRUIT=”cherry”

Q4. What would be the output of this command?

FRUIT=”Cherries”: echo $FRUIT are tasty

  •  Cherries are tasty
  •  echo Cherries are tasty
  •  $FRUIT are tasty

Q5.When you run the command alias from a terminal what will you see?

  •  It will display the help menu for a command.
  •  You will see output like the following:
  • alias egrep=’egrep –color=auto’
  • alias fgrep=’fgrep –color=auto’
  • alias grep=’grep –color=auto’
  • alias l.=’ls -d .* –color=auto’
  • alias ll=’ls -l –color=auto’
  • alias ls=’ls –color=auto’
  • alias which=’alias | /usr/bin/which –tty-only –read-alias –show-dot –show-tilde’

– [ ] It will print the name of the shell currently in use.

Q6. What is a good example of what appears in standard out?

  •  It is always blank.
  •  Errors from the improper execution of a shell command.
  •  The content of a file.

Q7. What is the output of this command?

ls fakefile.txt &> /dev/null

  •  It will create the file since it doesn’t exist.
  •  It will display the following error. ls: cannot access fakefile: No such file or directory
  •  There is no output.

Q8. What would the following command do?

ls fakefile 2> error.txt

  •  It deletes the output of stderr
  •  Write stderr to error.txt
  •  Write stdout to error.txt

Q9. What would this command do?

for i in (1..10); do echo $RANDOM >> rando.txt; done

  •  It appends 10 random numbers to a file.
  •  It overwrites a file with a new random number 10 times.
  •  It throws away the output of standard out.

Q10. What is happening in the following shell command?

sort -r < /etc/passwd

  •  The sort command is appending to the /etc/password file.
  •  The /etc/password file is reverse sorted.
  •  The /etc/password file is overwritten with a sorted version

 

Building Bash Scripts

Q1. What is an example of a control flow in Bash?

  •  A for loop.
  •  Making a script.
  •  Creating a variable.

Q2. What happens when this command runs?

false || echo “hi”

  •  An error prints to stdout.
  •  Nothing prints out.
  •  The word “hi” prints to stdout.

Q3. What happens when this command runs?

false && echo “hi”

  •  An error prints to stdout.
  •  The word “hi” prints to stdout.
  •  Nothing prints out.

Q4. Why would a data scientist need to truncate a large file before bringing it into a popular data scientist library like Pandas?

  •  To remove null values.
  •  It improves the accuracy of a prediction.
  •  To convert the data to a small data problem.

Q5. What would this statement return?

printf “hello\nworld\n” | grep hello

  •  Nothing.

  •  hello

  •  hello

    world

Q6. What is a key difference between find and locate?

  •  They are both the same command.
  •  The locate command uses metadata to search the filesystem.
  •  The find command uses metadata to search the filesystem.

Q7. What what this command do?

find . -perm /+x ! -name ‘.*’ -type -f

  •  Find all directories in the search path
  •  Find all executable non-invisible files.
  •  Find all files with the word x in them.

Q8. What would be the output of this command?

printf “apple\npear\npeach\n” | grep -v pear

  •  apple

    peach

  •  pear

  •  apple

    pear

    peach

Q9. What reason could a data scientists have for using the following command?

shuf -n 10000 data.csv > out-data.csv

  •  They want to truncate a file and grab the first 10000 rows.
  •  They want to randomly sample 10000 rows of a file.
  •  They want to truncate a file and grab the last10000 rows.

Q10. What does this program output?

while true; do echo “bob is your uncle”; sleep 2; done

  •  It sleeps for 2 seconds then quits with no output.
  •  It prints out “bob is your uncle” every 2 seconds.
  •  It prints out “bob is your uncle” twice then stops.

 

Composing File and Data Management Solutions with Linux

Q1. What would this command do?

locate -i .ZSHRC

  •  Find only occurrences of .ZSHRC
  •  Find only occurrences of .zshrc
  •  Find occurrences of both .ZSHRC and .zshrc

Q2. Which of these two time commands will be faster?

time sudo find / -name .zshrc

time locate .zshrc /etc/skel/.zshrc

  •  They are both the same speed to execute.
  •  The first command.
  •  The second time command using locate.

Q3. Which command moves files?

  •  mv
  •  cp
  •  touch

Q4. The following output describes how a UNIX file permission gets set. How would you apply this to a file called foo.txt?

  •  chmod 754 foo.txt
  •  touchchown root:root
  •  touchchmod -R 777 *

Q5. What would this command do?

zip -r archieves/foo.zip foo

  •  Nothing
  •  It creates a zip archive of the foo directory in the location archives/foo.zip
  •  It unzips archives/foo.zip

Q6. What does this command do?

tar -zcvf archieves/foo.tgz foo

  •  It creates an uncompressed archive.
  •  It creates an archive of the foo directory.
  •  Nothing.

Q7. Why would be the command to reserve sort the file foo.txt?

  •  less -r foo.txt
  •  sort -r < foo.txt
  •  rev < foo.txt

Q8. What is a straightforward way to count the unique lines in a file called fruit?

  •  sort fruit.txt
  •  uniq -c fruit.txt
  •  sort fruit.txt | uniq -c

Q9. What is the output of the following regex command?

echo 41-444-5599 ‘([0-9]{3})||[0-9]{3}[ -]?[0-9]{3}[ -]?[0-9]{4}’

  •  415-444-5599
  •  41-444-5599
  •  Nothing.

Q10. What would this command’s output be?

  •  POSITIVE
  •  NEGATIVE
  •  MIXED

Author

  • Helen Bassey

    Hi, I'm Helena, a blog writer who is passionate about posting insightful contents in the education niche. I believe that education is the key to personal and social development, and I want to share my knowledge and experience with learners of all ages and backgrounds. On my blog, you will find articles on topics such as learning strategies, online education, career guidance, and more. I also welcome feedback and suggestions from my readers, so feel free to leave a comment or contact me anytime. I hope you enjoy reading my blog and find it useful and inspiring.

    View all posts

About Helen Bassey

Hi, I'm Helena, a blog writer who is passionate about posting insightful contents in the education niche. I believe that education is the key to personal and social development, and I want to share my knowledge and experience with learners of all ages and backgrounds. On my blog, you will find articles on topics such as learning strategies, online education, career guidance, and more. I also welcome feedback and suggestions from my readers, so feel free to leave a comment or contact me anytime. I hope you enjoy reading my blog and find it useful and inspiring.

Leave a reply