시작하기 전에
- 실습에서는 정해진 기간 동안 Google Cloud 프로젝트와 리소스를 만듭니다.
- 실습에는 시간 제한이 있으며 일시중지 기능이 없습니다. 실습을 종료하면 처음부터 다시 시작해야 합니다.
- 화면 왼쪽 상단에서 실습 시작을 클릭하여 시작합니다.
Get the current directory information
/ 1
Change directory and list the subdirectories
/ 1
Locate and read the contents of a file
/ 1
Navigate to a directory and locate a file
/ 1
Get the current directory information
/ 1
Change directory and list the subdirectories
/ 1
Locate and read the contents of a file
/ 1
Navigate to a directory and locate a file
/ 1
Previously, you learned about Linux and how to communicate with the OS through the shell. You also learned how to use some of the core commands to navigate the Linux file system and read content from files it contains.
These are essential skills. For example, when investigating unauthorized access, you might navigate to and then read a user access report.
In this lab activity, you’ll navigate a Linux file structure, locate files, and read the contents of files. You’ll also need to answer a few multiple-choice questions based on the information contained in these files.
As a security analyst, it’s key that you know how to navigate, manage, and analyze files remotely via a Linux shell without a graphical user interface.
In this scenario, you have to locate and analyze the information of certain files located in the /home/analyst directory.
Here’s how you’ll do this: First, you’ll get the information of the current working directory you’re in and display the contents of the directory. Second, you’ll navigate to the reports directory and list the subdirectories it contains. Third, you’ll navigate to the users subdirectory and display the contents of the Q1_added_users.txt file. Finally, you’ll navigate to the logs directory and display the first 10 lines of a file it contains.
To complete these tasks, you'll need to use commands that you've previously learned in this course. Well, it's time to practice what you’ve learned. Let’s do this!
analyst, already logged in to the Bash shell. This means you can start with the tasks as soon as you click the Start Lab button.
You'll need to start the lab before you can access the materials. To do this, click the green “Start Lab” button at the top of the screen.
After you click the Start Lab button, you will see a shell, where you will be performing further steps in the lab. You should have a shell like this:
When you have completed all the tasks, refer to the End your Lab section that follows the tasks for information on how to end your lab.
In this task, you must use the commands you learned about to check the current working directory and list its contents.
The command to complete this step:
This will show that your current working directory is your home directory.
The command to complete this step:
The output should be:
Answer: The lab starts with /home/analyst as your current working directory.
Answer: The lab starts with four subdirectories in the /home/analystdirectory, namely logs, notes, temp, and reports.
Click Check my progress to verify that you have completed this task correctly.
In this task, you must navigate to a new directory and determine the subdirectories it contains.
/home/analyst/reports directory.The command to complete this step using a relative path:
cd command accepts absolute and relative paths. An absolute path includes all the directories from the root of the file system and starts with a /. An alternative is a relative path, which is expressed starting from the current directory and starts without the initial /. The above command uses a relative path.
The command to complete this step using an absolute path:
/home/analyst/reports directory.The command to complete this step:
The output should be:
Answer: The subdirectory contained in the /home/analyst/reports directory is called users.
Click Check my progress to verify that you have completed this task correctly.
In this task, you must navigate to a subdirectory and read the contents of a file it contains.
/home/analyst/reports/users directory.The command to complete this step:
The above command uses an absolute path. You could also use a relative path as follows:
The command to complete this step:
Q1_added_users.txt file.The command to complete this step:
cat command prints the contents of a file to the shell. You can specify the file to display using absolute or relative paths.
The same command using an absolute path:
Answer: The employee with username aezra works in the Human Resources department.
Answer: The employee_id of the employee with username mreed in the Information Technology department is 1104.
Click Check my progress to verify that you have completed this task correctly.
In this task, you must navigate to a new directory, locate a file, and examine the contents of the file.
/home/analyst/logs directory.The command to complete this step:
The command to complete this step:
This command will display the following output:
The command to complete this step:
head command displays just the beginning of a file, by default ten lines. You can specify how many lines to display using the -n argument, which specifies the number of lines to display.
Answer: There are three warning messages in the first 10 lines of the server_logs.txt file.
Click Check my progress to verify that you have completed this task correctly.
Great work!
You now have practical experience in using basic Linux Bash shell commands to
cd command,pwd command,ls command, andcat and head commands.Navigating through directories and reading file contents are fundamental skills that you’ll often use when communicating through the shell.
Before you end the lab, make sure you’re satisfied that you’ve completed all the tasks, and follow these steps:
현재 이 콘텐츠를 이용할 수 없습니다
이용할 수 있게 되면 이메일로 알려드리겠습니다.
감사합니다
이용할 수 있게 되면 이메일로 알려드리겠습니다.
한 번에 실습 1개만 가능
모든 기존 실습을 종료하고 이 실습을 시작할지 확인하세요.
실습을 시작하려면 이 간단한 단계를 완료하세요.