{ Intermediate Terminal Exercises. }

Part I

Answer the following questions:

  1. Create an environment variable called FIRST_NAME and set it equal to your first name (this does not need to be permanent)
  2. Print the FIRST_NAME variable
  3. Print out the $PATH variable
  4. What is the $PATH variable?
  5. Why would you want to create an environment variable?
  6. How do you permanently save environment variables?
  7. What is a process?
  8. How do you list all processes running on your machine?
  9. What is a PID?
  10. How do you terminate a process?
  11. What is the difference between kill and kill -9?
  12. What grep flag allows for case insensitive search?
  13. What grep flag allows for a certain number of lines before the match?
  14. What grep flag allows for a certain number of lines around the match?
  15. What grep flag allows for a certain number of lines after the match?
  16. What grep flag allows for full word search?
  17. What grep flag shows you the line number of a match?

Part II

Write the following terminal commands to do the following (assume that instructors.txt is an imaginary file):

  1. Find all files inside the Desktop folder that have a name of "learn."
  2. Find all files inside the Desktop folder that start with a "P."
  3. Find all files inside the Desktop folder that end with .txt.
  4. Find all files inside the Desktop/views folder that have the name data somewhere in their filename.
  5. Inside of the instructors.txt file, output the number of times the word "Elie" appears.
  6. Inside of the instructors.txt file, list all matches for any full word that starts with a capital "P."
  7. Inside of the instructors.txt file, list all the line numbers for any full word that starts with a "z" (it should match regardless of upper or lower case).

You can find the solutions here

When you're ready, move on to SSH

Continue

Creative Commons License