Project 1: Shell Commands
Note: If you are using Microsoft Windows, install
Windows Subsystem for Linux
before starting this assignment. I recommend enabling copy-and-paste.
In this assignment, you will have the opportunity to demonstrate your mastery of
Unix shell commands. Write a shell command that produces each of the following outputs:
Part 1: Due Friday, 1/22
- Listing of all files in a directory, including “hidden” files.
- A long-list of files in a directory, with file sizes in the most appropriate of the following: Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte
- The first fifteen lines of a file.
- The last fifteen lines of a file.
- Every line in a file containing the word “red”.
- All files in a directory ending with “txt”.
Submit Part 1 Solutions
Part 2: Due Monday, 1/25
- The five most recently modified files in the current directory.
- The five least recently modified files in the current directory.
- The number of files in the current directory.
- All Python files in the current directory or any of its recursive subdirectories.
- All Python files in the current directory that import the math module. Do not include the text from the file, only the filename.
- All currently executing Python programs.
- All files in the current directory, sorted from the largest number of lines to the smallest. Include the number of lines in the output.
- All files in the current directory, sorted from the smallest number of characters to the largest. Include the number of characters in the output.
Submit Part 2 Solutions
Assessment
- Level 1: At least 6/14 commands are correct.
- Level 2: At least 10/14 commands are correct.
- Level 3: All 14/14 commands are correct.