Skip to content

Latest commit

 

History

History
17 lines (13 loc) · 725 Bytes

Solution.md

File metadata and controls

17 lines (13 loc) · 725 Bytes

Task 5 solution

  1. info.csv includes records which contain names, emails and age. Extract all emails, sort them alphabetically, remove duplicates and save the output in the file emails.txt. (No need to display anything)
grep -o "[[:alnum:].]\+@[[:alnum:].]\+\.[[:alpha:]]\+" info.csv | sort | uniq > emails.txt
# alpha instead of alnum is fine
# forgetting the dot is not
# OR in this case, since the file is a csv
cut -d "," -f 2 info.csv | sort | uniq > emails.txt
  1. Find all the processes on your system (using ps) and sort them by the CMD column. Write the previous output into processes.txt. (No need to display anything)
ps -e --sort=command > processes.txt