Skip to content

Latest commit

 

History

History
40 lines (31 loc) · 562 Bytes

Solutions.md

File metadata and controls

40 lines (31 loc) · 562 Bytes

Session 6: Text processing

Task Solutions!

1. Sort, Rev, Uniq, Cut, Tr

rev /etc/shells | cut -d '/' -f 1 | rev | sort | uniq | tr ':' '='

2. Paste

paste names ages

3. Grep

1 - Emails

grep -E '.+@.+\..{2,3}' emails.txt

2 - Discord usernames

grep -E '.+#([0-9]){4}$' discord.txt

3 - Credit cards

grep -E '([0-9])\s?\1' cards.txt

4. Sed

sed 's/#.*//' names_not_clean.txt | sed 's/-.*//'

5. Awk

awk '/^[A-Z]/ {print $NF}' names2.txt