Linux and Bash for Data Engineering Week3
.docx
keyboard_arrow_up
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
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
Related Questions
Interpret my solution. Thanks
arrow_forward
Thonny C\Users\iqueous fixxbuzz.py @ 12:5
File Edit View Run Tools Help
▸ 33. I STOP
beginl.py
1
2
3
4
5
8
fixxbuzz.py* X trials.py
def fizz():
print (number, "Fizz")
def buzz ():
print (number, "Buzz")
def FizzBuzz():
print (number, "FizzBuzz")
def nothing():
print (number)
for number in range(101):
if number % 3==0 and number % 5==0:
FizzBuzz()
elif number % 5==0:
buzz ()
elif number % 3==0:
fizz ()
nothing ()
else:
Type here to search
O
arrow_forward
response page checks username and
password against arrays of valid usernames
and passwords (normally this is done
against a database - we'll change it later)
If valid - saves username to cookie, and sets
session variable LoggedIn to TRUE. If not,
sets the session variable to FALSE.
Displays link to "content page" (the page
you're protecting).
Created with Mi Notes
arrow_forward
Bash shell
arrow_forward
{:00
a 4.ll KOREK
docs.google.com/forms
1-You can rename any file by clicking
at paste command. *
True
O False
2-You can cut any folder by clicking
at cut command. *
O False
O True
3-You can change the language of
naming any folder by clicking at
CTRL+SHIFT. *
O True
False
arrow_forward
mming in Business || fall20
Ahmed created a loop that accepts integers from users and starts
calculating the maximum after the user input zero. This loop is an
example of a counter-controlled loop.
on
Select one:
O True
O False
Next page
MacBook Pro
公
arrow_forward
Create a new script and name it texas_right.sh . Your script should do the following:
1- Create and then enter a folder called texas37 in your home directory.
2- Create two folders called input and output
3- Create a script to loop from 1 to 100.
4- On each iteration of the loop create a file that:
a. Has a filename that indicates the value of the loop iteration. hint: give each file name a structured format i.e the same extension or have the index in the file name
b. Contains the text result of the operation mod(5) repeated 10 times
5.Create a new script and name it washington.sh . Your script should do the following:
6- Create a script to loop through all the input files in the input folder, uses the head command (only first 5 lines) with the redirect operation to generate a new file in the output folder.
arrow_forward
how to fix this
arrow_forward
Implementing User Input and
Comments in a Script
1. Go to your main.py file.
2. On the first line, add a docstring explaining what your
file does. Then, assign a variable called whole_num to
the user's input and cast it to an integer.
3. Next, print 10 underscores as the top border of the
table.
4. On the first line print your whole number, then
multiply your whole number by multiples of 2's till 10
and print that out.
5. Finally, print 10 underscores again for the bottom
border of the table, as in step 3.
6. Run the file by using the python3 main.py command.
The output should be like Figure 1.10.
>_ Terminal
workspace $ python3 main.py
Generate a multiplication table for: 7
Number: 7
2: 14
4: 28
6: 42
8: 56
10: 70
workspace $
x +
Figure 1.10
arrow_forward
CENTENNIAL COL GE: LAB TEST SUBMISSION
Debug the following bash script:
# Prompt the user and get input for username and password and store username #in a
variable and password in another variable.
#Write this information in two files as userlogin. txt and passlogin.txt.
# start
echo "Enter username"
read username
echo "Enter password"
read password
if [I (Susername = "guest" & $password = "etec" ) ]]: then
echo Şusername > userlogin.txt passlogin.txt
else
echo "invalid user"
fi
arrow_forward
Screenshot must. Re-Write the whole
Not remove any functionality/ functioning
Downvote is there. For incorrect
arrow_forward
Select the correct command, term, or option.
This term describes a predesigned file with formatting and graphical elements on which you can base a file; using a template is a quick way to create a
Choose..
professional-looking file (document, presentation, spreadsheet, or database).
This term describes an interface element that contains a variety of options and commands that allow you to manage your files and perform tasks such as
Choose.
saving and printing.
Use this button to return to an open file from the backstage area.
Choose.
Click this tab to display the backstage area.
Choose..
The name of the open file displays on this area at the top of the workbook.
Choose.
Click this button to display the previous folder level.
Choose.
A OneDrive account or USB flash drive is an example of this, which is the place you save a file on the computer.
Choose.
This part of the file should be descriptive of the file contents so you can easily find the file you need.
Choose..
Click this option in…
arrow_forward
Select all of the following Bash filename patterns that would only match the following filenames (i.e., no other files except these four could ever be matched by the chosen pattern(s)):
syscore5a.bin
syscore5b.bin
syscore9b.bin
syscore9a.bin
O syscore (5,9) {a,b).bin
O syscore{519} {a|b}.bin
O syscore [59] (a, b}.bin
O syscore [519] [alb].bin
O syscore [59ab].bin
O syscore [59] [ab].bin
O syscore [5, 9] [a,b].bin
O syscore (5,9}[ab].bin
arrow_forward
Using python
arrow_forward
1) Write a bash script to demonstrate while loop which displays "While Loop Demo" and exits when key q is typed.
2) Write a bash script using while loop which displays date, your username and current directory every 15 seconds
scripts MUST be in bash shell linux commands
arrow_forward
Bash Shell Scripting – Misc. Commands
Create a bash script ~/test4.sh with any text editor.
Write a bash script that does the following:
echo "File Name: $0"
echo "First Parameter : $1"
echo "Second Parameter : $2"
echo "Quoted Values: $@"
echo "Quoted Values: $*"
echo "Total Number of Parameters : $#"
Take a screenshot of the console output.
Run your scripts after doing a chmod 777 on the script.
Open a terminal window and run the following commands:
which gcc
man gcc
arrow_forward
We can create a new text file with the following commands, except:
Group of answer choices
TYPE
ECHO with >
FSUTIL FILE CREATENEW
NUL >
arrow_forward
DO NOT COPY FROM OTHER WEBSITES
Upvote guarenteed for a correct and detailed answer. Thank you!!!
arrow_forward
Html code . Put up code with screenshot
arrow_forward
Format of file called deltafleet.txt
aircraftName
regnum
manufacturer
maxSize
crewSize
yearPutInService
maxServiceWeight
numPassengers
currentAirMiles
lastMaintenanceDate
lastMaintenanceMiles
What would be best way to read from a file using file and Scanner with try-catch block.
I also have to write and append to a file called newfleet.txt. what would be best way of doing that
In Java with traditional for Loops that a beginner programmer would use.
arrow_forward
write java code
The wise university like to manage Student records uSig a desktop application. The program's main Window includes two options (can be implemented Lßing buttons Ot Similar components). These options are: add a new record and display search and edit records. To implement such an application. you need to implement the following: Create three frames, one as the main application frame Frame) and two hidden frames (add New Record and Display, search and Edit record) that are displayed only through events implemented the mainframe (two buttons). The components Of the secondary windows are follows: Add New Record: use proper components to allow to add the fo"owing information for each student (Name. Gender, University ID. National ID. Nationality, Tawjihi Graduate Year, Major, Academic Department, and Faculty). Note; are not always the right option user inputs When there options for some inputs. Display, and Edit Record: use Components to the user to display the students'…
arrow_forward
WEB DEVELOPMENT IS THE SUBJECT
QUESTION -
Create a Application that allows the user to customize the web page. Your design
must include CSS. The application should consists of three files as follows
a. Ask the user to login and read form the database to determine the
authentication. If the user is not known, the second file is loaded asking
the user to fill up the form to store personal data
b. Write a Java script to check the user is known user
c. Use cookies for storing the user details and display the user name when
the user moves on the next page.
arrow_forward
Please help me with this. I am not understanding how and what to do?
arrow_forward
uagm.blackboard.com/webapps/assessment/take/launch.jsp?course_assessment jd3 1971
YouTube
W Maps Discord Fonts (copy..
V Citation Form | APA...
Aplicaciones M Gmail
This test has a time limit of 2 hours and 30 minutes.This test will save and submit autom
Warnings appear when half the time, 5 minutes, 1 minute, and 30 seconds remain.
Multiple Attempts Not allowed. This test can only be taken once.
Force Completion This test can be saved and resumed at any point until time has expired. The timer will co
Your answers are saved automatically.
Remaining Time: 2 hours, 20 minutes, 55 seconds.
¥ Question Completion Status:
QUESTION 1
To expand a 2-bit parallel adder to a 4-bit parallel adder, you must
Oa.use two 2-bit adders with no interconnections
Ob.use two 2-bit adders and connect the sum outputs of one to the bit inputs of the other
Oc use four 2-bit adders with no interconnections
O d. use two 2-bit adders with the carry output of one connected to the carry input of the other
QUESTION 2…
arrow_forward
MCQ
A developer added a special function in a .php file that will remove semicolons, dashes, quotes and comma from an input filed that accept a string data type. Which of the following attacks this function will help to stop?
a
Error handling to protect against website exploitation.
b
Exception handling to protect against XSRF attack.
c
Input validation to protect against SQL injection.
d
Padding to protect against string buffer overflows.
arrow_forward
Transcribed Image Text
/* you have a sceneraio for recruting app */ In which you have two types of Record type on Position Object one is for Technical and one is non technical Record type. you have to write a SOQL query to fetch All the reocrd type of the ID of Technical Record Type. Please Run the SOQL Query on the Anonymous Window. also please attach the screenshot of the output. Apex, Salesforce
arrow_forward
Create a folder named LastName_FirstName(please write Dahanyoon (ex. Reyes_Mark) in your local
Create a new project named LabExer5A. Set the project location to your own
The program shall:
generate a random number from 1 to 50 for a player to guess;
display a message that indicates whether the player’s guess is correct, too low, or too high; and
prompt the user to keep on guessing until the correct value is entered
Create a try-catch structure that will handle two (2) exceptions. These are when the user inputs the following:
a number that is out of range (1 – 50)
a letter or any non-numeric character
Prompt the user so that he can guess again if an exception is
Display the number of total
Note: An invalid input (when an exception is thrown) is not considered a valid guess or attempt.
arrow_forward
Execute the following LINUX commands. Take the screen shot of each answer and paste after the question.
a)Create a .txt file by giving your Student ID as name of the file in Maths
Example: 2019193001.txt
b)Execute the command to list all the files end with word “ths” in the current directory.
c) Execute a command to get help about remove file
d)Execute a command to move contents of file txt to introduction_maths.txt
e) Execute a command to copy the file created in question 4 to your home folder.
f)Execute a command to clear the screen
g) Execute a command to search the file txt for the word “math”
Note: command should ignore the case and it should only print the count of matching lines.…
arrow_forward
Which commands can you use to take a paragraph from one file and insert it in a second file?
arrow_forward
5. Zip your folder then submit only the zipped file on blackboard.
arrow_forward
Name of Experiment: Permissions in Ubuntu
Change the permissions
Permissions can be changed with `chmod` command. Suppose you want to change the permission for a particular file or a folder, the first approach is through `chmod` command.
Changing Ownership and Group
Change the ownership of a file/directory
Example: chown user filename
Provide screenshot of you work
arrow_forward
Lab 6.3 Download SavingAccount.py (See below). Overload the following operator:’
==: return True when all attributes of two objects are equal
> : return True if the balance of the account on the left is great than the balance
of the account on the right
Write a script that create 2 accounts. Then test the == and > operator.
"""
File: bank.py
This module defines the SavingsAccount.
"""
class SavingsAccount(object):
"""This class represents a savings account
with the owner's name, PIN, and balance."""
RATE = 0.02
def __init__(self, name, pin, balance = 0.0):
self._name = name
self._pin = pin
self._balance = balance
def __str__(self):
result = 'Name: ' + self._name + '\n'
result += 'PIN: ' + self._pin + '\n'
result += 'Balance: ' + str(self._balance)
return result
def getBalance(self):
return self._balance
def getName(self):
return self._name…
arrow_forward
add tags for these feature files with --tags option:
When you select scenarios by one tag
When you select scenarios that have one or another tag
When you select scenarios that have 2 tags
When you disable scenarios that have a specific tag
Given Scenarios:
Feature: Login functionalityBackground:Given a web browser is at the BrainBucket login pageScenario: user can't login without entering emailGiven User is not logged inWhen Password is enteredAnd User click Login buttonThen 'Warning: No match for E-Mail Address and/or Password' will be shownScenario: user can recover his passwordGiven User is not logged inWhen User clicks 'Forgotten Password' buttonAnd enters his emailThen Message 'An email with a confirmation link has been sent your email address.' will be dispalyed
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Related Questions
- Interpret my solution. Thanksarrow_forwardThonny C\Users\iqueous fixxbuzz.py @ 12:5 File Edit View Run Tools Help ▸ 33. I STOP beginl.py 1 2 3 4 5 8 fixxbuzz.py* X trials.py def fizz(): print (number, "Fizz") def buzz (): print (number, "Buzz") def FizzBuzz(): print (number, "FizzBuzz") def nothing(): print (number) for number in range(101): if number % 3==0 and number % 5==0: FizzBuzz() elif number % 5==0: buzz () elif number % 3==0: fizz () nothing () else: Type here to search Oarrow_forwardresponse page checks username and password against arrays of valid usernames and passwords (normally this is done against a database - we'll change it later) If valid - saves username to cookie, and sets session variable LoggedIn to TRUE. If not, sets the session variable to FALSE. Displays link to "content page" (the page you're protecting). Created with Mi Notesarrow_forward
- Bash shellarrow_forward{:00 a 4.ll KOREK docs.google.com/forms 1-You can rename any file by clicking at paste command. * True O False 2-You can cut any folder by clicking at cut command. * O False O True 3-You can change the language of naming any folder by clicking at CTRL+SHIFT. * O True Falsearrow_forwardmming in Business || fall20 Ahmed created a loop that accepts integers from users and starts calculating the maximum after the user input zero. This loop is an example of a counter-controlled loop. on Select one: O True O False Next page MacBook Pro 公arrow_forward
- Create a new script and name it texas_right.sh . Your script should do the following: 1- Create and then enter a folder called texas37 in your home directory. 2- Create two folders called input and output 3- Create a script to loop from 1 to 100. 4- On each iteration of the loop create a file that: a. Has a filename that indicates the value of the loop iteration. hint: give each file name a structured format i.e the same extension or have the index in the file name b. Contains the text result of the operation mod(5) repeated 10 times 5.Create a new script and name it washington.sh . Your script should do the following: 6- Create a script to loop through all the input files in the input folder, uses the head command (only first 5 lines) with the redirect operation to generate a new file in the output folder.arrow_forwardhow to fix thisarrow_forwardImplementing User Input and Comments in a Script 1. Go to your main.py file. 2. On the first line, add a docstring explaining what your file does. Then, assign a variable called whole_num to the user's input and cast it to an integer. 3. Next, print 10 underscores as the top border of the table. 4. On the first line print your whole number, then multiply your whole number by multiples of 2's till 10 and print that out. 5. Finally, print 10 underscores again for the bottom border of the table, as in step 3. 6. Run the file by using the python3 main.py command. The output should be like Figure 1.10. >_ Terminal workspace $ python3 main.py Generate a multiplication table for: 7 Number: 7 2: 14 4: 28 6: 42 8: 56 10: 70 workspace $ x + Figure 1.10arrow_forward
- CENTENNIAL COL GE: LAB TEST SUBMISSION Debug the following bash script: # Prompt the user and get input for username and password and store username #in a variable and password in another variable. #Write this information in two files as userlogin. txt and passlogin.txt. # start echo "Enter username" read username echo "Enter password" read password if [I (Susername = "guest" & $password = "etec" ) ]]: then echo Şusername > userlogin.txt passlogin.txt else echo "invalid user" fiarrow_forwardScreenshot must. Re-Write the whole Not remove any functionality/ functioning Downvote is there. For incorrectarrow_forwardSelect the correct command, term, or option. This term describes a predesigned file with formatting and graphical elements on which you can base a file; using a template is a quick way to create a Choose.. professional-looking file (document, presentation, spreadsheet, or database). This term describes an interface element that contains a variety of options and commands that allow you to manage your files and perform tasks such as Choose. saving and printing. Use this button to return to an open file from the backstage area. Choose. Click this tab to display the backstage area. Choose.. The name of the open file displays on this area at the top of the workbook. Choose. Click this button to display the previous folder level. Choose. A OneDrive account or USB flash drive is an example of this, which is the place you save a file on the computer. Choose. This part of the file should be descriptive of the file contents so you can easily find the file you need. Choose.. Click this option in…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education