Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
The command line is something you will interact with often when using Linux, both as a developer and admin. Knowing how it works and what commands you can use can greatly increase your productivity. In this learning path, you will get started with the Linux command line. You will:
Prerequisites:
None
Use Bash to manage IT infrastructure.
Learning objectives:
In this module, you will:
Prerequisites:
None
This module is part of these learning paths:
Q1. What directory would you switch to if you entered the Bash command cd .
?
Q1. Which of the following commands writes a list of processes associated with a user named scottgu to a file?
cat | grep scottgu > processes.txt
cat > grep scottgu | processes.txt
ps -ef | grep scottgu > processes.txt
Q2. Which of the following commands, called with the -r
option, would you use to delete a subdirectory that isn’t empty?
rm
rmdir
nuke
Q3. Which of the following commands combines the contents of foo.txt and bar.txt into a new file named foobar.txt?
concat foo.txt bar.txt > foobar.txt
cat foo.txt bar.txt | foobar.txt
cat foo.txt bar.txt > foobar.txt
Q4. The purpose of the sudo
command is to:
Q5. Which of the following statements is true about the command python3 app.py &
?
Learn how to use the UNIX shell to wrangle data and inspect data files.
Learning objectives:
In this module, you’ll learn how to:
head
, tail
, wc
, less
, and sort
.cat
command to create, append, display, and concatenate files.grep
command to search files, or stdin
content for pattern matching along with regex.sed
and regex.Prerequisites:
This module is part of these learning paths:
Q1. In our current directory, we want to find the three files with the least number of lines. Which command would work?
wc -l * > sort -n > head -n 3
wc -l * | sort -n | head -n 1-3
wc -l * | sort -n | head -n 3
wc -l * | head -n 3 | sort -n
Q2. What will the regular expression Fr[ea]nc[eh]
match?
Q3. The -v
option to the grep
command inverts pattern matching so that only lines that don’t match the pattern are printed. Which of the following commands will find all files in the /data directory whose names end in s.txt
, but whose names also don’t contain the string net
? Examples are shuttles.txt
or software.txt
, but not planets.txt
.
find data -name *s.txt | grep -v net
grep -v 'net' $(find data -name '*s.txt')
find data -name '*s.txt' | grep -v net
Q4. Suppose you want to delete some processed data files and only keep your raw files and processing script to save storage. The raw files end in .dat
, and the processed files end in .txt
. Which of the following solutions would remove all of the processed data files, and no other files?
rm ?.txt
rm *.txt
rm * .txt
rm *.*
I hope this Get started with the Linux command line and the Shell Microsoft Quiz Answers would be useful for you to learn something new from this problem. If it helped you then don’t forget to bookmark our site for more Coding Solutions.
This Problem is intended for audiences of all experiences who are interested in learning about Data Science in a business context; there are no prerequisites.
Keep Learning!
More Coding Solutions >>