WK3 Ungraded exemplar (Filerting) Flashcards

1
Q

Task 1

A

In this task, you must navigate to the /home/analyst/logs directory and report on the error messages in the server_logs.txt file. You’ll do this by using grep to search the file and output only the entries that are for errors.

  1. Navigate to the /home/analyst/logs directory.
    The command to complete this step:
    cd logs
  2. Use grep to filter the server_logs.txt file, and return all lines containing the text string error.
    grep error server_logs.txt
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Task 2

A

Task 2. Find files containing specific strings

In this task, you must navigate to the /home/analyst/reports/users directory and use the correct Linux commands and arguments to search for user data files that contain a specific string in their names.

  1. Navigate to the /home/analyst/reports/users directory.
    The command to complete this step:
    cd /home/analyst/reports/users
  2. Using the pipe character (|), pipe the output of the ls command to the grep command to list only the files containing the string Q1 in their names.
    The command to complete this step:
    ls | grep Q1
  3. List the files that contain the word access in their names.
    The command to complete this step:
    ls | grep access
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Task 3

A

Task 3. Search more file contents

In this task, you must search for information contained in user files and report on users that were added and deleted from the system.

  1. Display the files in the /home/analyst/reports/users directory.
    The command to complete this step:
    ls
  2. Search the Q4_added_users.txt file to list the users who were added to the Human Resources department.
    The command to complete this step:
    grep “Human Resources” Q4_added_users.txt
  3. Search the Q4_added_users.txt file to list the users who were added to the Human Resources department.
    The command to complete this step:
    grep “Human Resources” Q4_added_users.txt
How well did you know this?
1
Not at all
2
3
4
5
Perfectly