350-201 exam dumps

350-201 practice question 274 of 289

Cybersecurity Professional - Performing Cybersecurity Using Cisco Security Technologies. Professional level, Cisco. Free question with the correct answer and a full explanation.

350-201 Question 274

Select 2

You are troubleshooting a potential security issue on a Linux-based server. You suspect that a malicious script has been created in the /tmp directory and want to list all files in that directory to verify. Additionally, you need to check if the MY_ENV environment variable has been set, as it may be part of the script's behavior. Which of the following Bash commands would you use to efficiently complete both tasks?

  1. A

    ls /tmp

  2. B

    echo $MY_ENV

  3. C

    export MY_ENV

  4. D

    cd /tmp && ls

  5. E

    cat /tmp/MY_ENV

Show answer and explanation

Correct answers: A, B

Explanation

To troubleshoot the issue, you need to list the files in the /tmp directory to identify any malicious scripts and check the value of the MY_ENV environment variable. The ls /tmp command lists the directory contents, while echo $MY_ENV reveals the value of the environment variable. These commands directly address the tasks and are efficient for the scenario.

  • A. Correct.

    Correct. The ls /tmp command lists all files in the /tmp directory, which is essential for identifying any malicious files.

  • B. Correct.

    Correct. The echo $MY_ENV command displays the value of the MY_ENV environment variable, allowing you to verify if it has been set.

  • C. Incorrect.

    Incorrect. The export MY_ENV command is used to set or export the MY_ENV environment variable, not to check its current value.

  • D. Incorrect.

    Incorrect. The cd /tmp && ls command lists files in /tmp after changing the directory, but it is redundant compared to just using ls /tmp. While functional, it is less efficient for this scenario.

  • E. Incorrect.

    Incorrect. The cat /tmp/MY_ENV command attempts to display the contents of a file named MY_ENV in the /tmp directory, which is not relevant to checking an environment variable or listing files.

Timed practice exam

Take a 350-201 practice test under exam conditions

75 questions in 120 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam