L01 - Command Line Fundamentals
Introduction
This lab will require you to use the knowledge you gained from Module 01 of UNIX, the command line, and Git.
Prerequisites
By now, you should have your development environment set up and ready to go. After accepting the assignment in GitHub Classroom, you should have a repository created for you to work in. You will need to clone the lab repository by running the following command in your development environment:
git clone <your-repository-url> lab-01
After cloning the repository, you should have a new directory called lab-01 in your development environment. You will be working in this directory for the duration of the lab.
Some Useful Commands
Here are some useful commands that you may want to use during the lab:
man <command>- displays the manual page for a commandgrep- searches for a pattern in a filecat- displays the contents of one or more fileshead- displays the first few lines of a filetail- displays the last few lines of a filecomm- compares two sorted files line by linesort- sorts the contents of a file (alphabetically by default)uniq- removes duplicate consecutive lines from a fileaspell- spell checker
Data Files
In this lab, you will be working with the following data files fond in /data/:
some_words.txt- a text file containing a list of wordssome_more_words.txt- a text file containing a list of wordsessay.txt- a text file containing an essayserver.log- a log file from a server
Tasks
Pipe your results for each task into its corresponding file in the results/ directory.
-
server_errors.txt- List all the error messages inserver.log. -
all_words.txt- List all unique words used insome_words.txtandsome_more_words.txtin alphabetical order.HintYou can
catmultiple files. -
common_words.txt- List all the words that are common betweensome_words.txtandsome_more_words.txt.HintYou may want to use the
commcommand to compare the two files. Check its manual page to see how to use it. -
misspelled.txt- List all the unique misspelled words inessay.txtaccording toaspellin alphabetical order.HintIt may be helpful to look at
aspell's manual page to see how to use it. You can do this by runningman aspell. You can also use the--helpflag to see a list of options.You probably want to somehow list any misspelled words. 😉
Submission
After completing the tasks, you should have four files in the results/ directory. You should commit and push these files to your repository by running the following commands:
git add results/
git commit -m "<your-message>"
git push
After pushing your changes, you should see the files in your repository on GitHub. You can verify this by visiting your repository on GitHub and navigating to the results/ directory.
Now, submit your repository to the Gradescope assignment for this lab. You will be able to see the results of the testcases run on your repository. You can resubmit as many times as you like before the deadline.