Programming Tools & Computer Science I

CSC 185 & 201, Spring 2013, Northern Virginia Community College

Homework 5: I/O redirection

2013-02-13

Due:

Feb 20, 11:59PM

To submit:

Send an email with your answers to me at jal2016@email.vccs.edu with subject CSC 185 HW5.

Directions:

  1. List the commands you could use to create a file (using only the command line) with the following contents:
    I created this
    file using only commands;
    I don't need Notepad.
    Hint: the command echo x y z will print "x y z" to the console.
  2. The findstr command works like find, except you can specify a regular expression to search for. Type find /? to see more information about its usage.

    How can you use the findstr command in combination with dir to list all files that start with a, b, c, d, e, f, or g?

  3. The assoc command can list or modify file extension associations, and the ftype command can list or modify the programs used to open a particular file type.

    How can you use the ftype and find commands to determine all file types that are opened using Notepad? Hint: depending on your setup, you might need to tell find to ignore case (to not care whether words have any capital letters or not); use find/? to see how to do that.