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/20

  1. Listing of all files in a directory, including “hidden” files.
  2. 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
  3. The first fifteen lines of a file.
  4. The last fifteen lines of a file.
  5. Every line in a file containing the word “red”.
  6. All files in a directory ending with “txt”.

Submit Part 1 Solutions

Part 2: Due Monday, 1/23

  1. The five most recently modified files in the current directory.
  2. The five least recently modified files in the current directory.
  3. The number of files in the current directory.
  4. All Python files in the current directory or any of its recursive subdirectories.
  5. All Python files in the current directory that import the math module. Do not include the text from the file, only the filename.
  6. All currently executing Python programs.
  7. All files in the current directory, sorted from the largest number of lines to the smallest. Include the number of lines in the output.
  8. 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

  • Partial: At least 8/14 commands are correct.
  • Complete: 14/14 commands are correct.