CGS3767 Assignment 4

Due Friday, 4/19 (late 6am 4/20)

Linux

Write a script in Linux for the following.

  1. Use the find command in Linux for the following.
    1. Write the command that will find all normal files (not directories) in the current folder and subdirectories with the permission 700.
    2. Write the command that will find all normal files (not directories) in the current folder and subdiretories with the permission 700 AND with a name that has the extension .wav.
    3. Write the command that will find all normal files (not directories) in the current folder and subdiretories with the permission 700 OR with a name that has the extension .wav.
    4. Write the command that will find all normal files (not directories) in the current folder and subdirectories that are older (not newer) than the file file.txt, in the current folder.
    5. Write the command that will find all normal files (not directories) in the current folder (but not subdirectories) with the permission 700 and change them to the permission 600.
    6. Write the command that will find all normal files (not directories) in the current folder and subdirectories that are empty and delete them.
  2. Use sed for the following. Access this file from ocelot: ~downeyt/public_html/cgs3767/sed.txt, or from the web: sed.txt. Answer the following questions:
    1. Write the command that will print lines that start with a capital T. Only print the matching lines.
    2. Write the command that will print lines that start with a capital T. Only print the matching lines. For each matching line, change all lower case e to upper case EE.
    3. Write the command that will change the letter h to upper case, if it starts a word. Only print matching lines.
    4. Write the command that will change all double consonants (the same consonant) to upper case.
    5. Write the command that will add *** to the start of each line.
    6. Write the command that will delete all vowels (upper and lower case) and then change all sequences of double letters (the same letter, same case) to upper case. Use one sed command, do not use a pipe with two sed commands. Print all lines from the file.
  3. Use grep for the following
    1. Find all files in the current folder that contain a number that is greater than 999.
    2. Find all files in the current folder that contain a word of lower case letters that is longer than ten characters.
    3. Find all files in the current folder and sub-folders that contain a username that has the FIU format: from three to five lower case letters followed by three digits.
  4. Read the man page for the cut and sort commands. Access this file from ocelot: ~downeyt/public_html/cgs3767/sort.txt, or from the web: sort.txt. Answer the following questions:
    1. Write the command that will set the delimiter to the colon and cut the second field from the file and display it.
    2. Write the command that will set the delimiter to the colon and sort the file by the second field.
    3. Write the command that will set the delimiter to the colon and cut the second field from the file and sort it. Use cut and pipe the result into sort.
    4. Write the command that will set the delimiter to the colon and cut the third field from the file and sort it numerically.
    5. Write the command that will set the delimiter to the colon and` cut the first, third and fifth field from the file and sort them numerically by the numeric field.

Windows

Write a script in Windows for the following.

  1. Use the dir command for the following:
    1. Write the command that will find all normal files (not directories) in the current folder and subdirectories that have a bat extension.
    2. Write the command that will find all directories (not normal files) in the current folder and subdirectories that start with the letter A.
    3. Write the command that will find all hidden files and folders in the current folder and subdirectories.
  2. Use findstr for the following
    1. Find all files in the current folder that contain a number that is greater than 999.
    2. Find all files in the current folder that contain a word of lower case letters that is longer than ten characters.
    3. Find all files in the current folder and sub-folders that contain a username that has the FIU format: from three to five lower case letters followed by three digits.

Hand In Assignment

You should have two script files. Create a zip file containing these files and upload the zip file to me, as binary. Do not create a .rar file.

You then have a choice for submitting the file.

When you are asked for a username and password, use your webmail username with the password that I sent to you. Upload the file as binary. If you upload as text, nothing will be uploaded. Check that the size of the uploaded file is correct.