The readings for Monday, February 6 are:
Work through the Lessons in the Interactive Tutorial.
The focus of this reading is to introduce regular expressions and revisit filters and pipelines.
Optional Resources:
Digital Ocean Tutorials:
In your reading03/README.md
file, describe what command(s) you would use to
accomplish the following:
Convert all the input text to upper case:
$ echo "All your base are belong to us" | ... ALL YOUR BASE ARE BELONG TO US
Find and replace all instances of monkeys
to gorillaz
:
$ echo "monkeys love bananas" | ... gorillaz love bananas
Remove any leading whitespace from a string of text:
$ echo " monkeys love bananas" | ... monkeys love bananas
Parse the /etc/passwd
file for the shell of the root user:
$ cat /etc/passwd | ... /bin/bash
Hint: You may need to read up on the format of /etc/passwd
Find and replace all instances of /bin/bash
, /bin/csh
, and /bin/tcsh
to
/usr/bin/python
in /etc/passwd
:
$ cat /etc/passwd | ... | grep python root:x:0:0:root:/root:/usr/bin/python mysql:x:27:27:MySQL Server:/var/lib/mysql:/usr/bin/python xguest:x:500:501:Guest:/home/xguest:/usr/bin/python condor:x:108172:40:Condor Batch System:/afs/nd.edu/user37/condor:/usr/bin/python lukew:x:522:40:Luke Westby temp access:/var/tmp/lukew:/usr/bin/python
Find all the records in /etc/passwd
that have a number that begins with
a 4
and ends with a 7
:
$ cat /etc/passwd | ... rtkit:x:499:497:RealtimeKit:/proc:/sbin/nologin qpidd:x:497:495:Owner of Qpidd Daemons:/var/lib/qpidd:/sbin/nologin uuidd:x:495:487:UUID generator helper daemon:/var/lib/libuuid:/sbin/nologin mailnull:x:47:47::/var/spool/mqueue:/sbin/nologin
Given two text files, show all the lines that are present in both files.
Given two text files, show which lines are different.
If you have any questions, comments, or concerns regarding the course, please provide your feedback at the end of your response.
To submit your assignment, please commit your work to the reading03
folder
in your assignments GitLab repository:
$ cd path/to/repository # Go to assignments repository $ cd reading03 # Go to reading directory ... $ $EDITOR README.md # Edit README.md $ git add README.md # Mark changes for commit $ git commit -m "reading03: README.md" # Record changes ... $ git push # Send changes to GitLab