Brent wants to find all developers common to cpp_developers.txt and rust_developers.txt and output them to common_developers.txt. Each developer is on 1 line in each file in this format: last_name.first_name
Show all commands he'll need to run on his Fedora Linux system.
- Change the current working directory to the directory where the two files are located: cd /path/to/files
- Use the
commcommand to find the lines that are common in both files:
- sort cpp_developers.txt rust_developers.txt | uniq -d > common_developers.txt
sortcommand sorts the lines in both files and passes them to the
uniqto only output lines that appear more than once.
>operator redirects the output to a file called
- View the contents of
common_developers.txtto verify that the correct developers were found.
- cat common_developers.txt
- Email the developers whose names are in the new file using the
Overall, the commands that Brent will need to run are:
sort cpp_developers.txt rust_developers.txt | uniq -d > common_developers.txt