Activity: Get help in the command line

실습 1시간 universal_currency_alt 무료 show_chart 입문
info 이 실습에는 학습을 지원하는 AI 도구가 통합되어 있을 수 있습니다.
이 콘텐츠는 아직 휴대기기에 최적화되지 않음
최상의 경험을 위해 데스크톱 컴퓨터에서 이메일로 전송된 링크를 사용하여 방문하세요.

Activity overview

As a security analyst, you won’t have all the answers all the time, but you can learn where to find them. One of the great things about Linux is that you can get help right through the command line.

In this lab activity, you’ll use the man and whatis commands to get information on other commands and how they work. You’ll also use the apropos command to search the manual page for a command with a specified string.

When working as a security analyst, you'll likely find it useful to know how to discover which command to use or information about what commands do.

With that in mind, let’s explore your scenario.

Scenario

In this scenario, you have to find more information about commands that you need to use. You also need to discover which command to use to perform a certain task.

Here’s how you’ll do this task: First, you’ll explore a few commands you can use in the shell to learn more about other commands. Next, you’ll find an option you need to add to a command. Third, you’ll use a command to get a brief description of commands so you can identify their differences. Finally, you’ll identify the command you need to perform a task.

It's time to get ready to explore some of the Linux help resources!

Disclaimer: For optimal performance and compatibility, it is recommended to use either Google Chrome or Mozilla Firefox browsers while accessing the labs.

Start your lab

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.

Lab Start button displayed.

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:

Linux Terminal displayed.

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.

Task 1. Learn more about commands

In this task, you need to explore a few commands you can use in the shell to learn more about the functionality of other commands.

First, imagine you can’t quite remember what the cat command does and want a quick reminder.

  1. Run the whatis command to get a short description of cat.

Next, imagine that you want more details about cat and all of its options.

  1. Use the man command to get more details about cat.

The man command returns a general description of cat and information about each of its options:

CAT(1) User Commands CAT(1) NAME cat - concatenate files and print on the standard output SYNOPSIS cat [OPTION]... [FILE]... DESCRIPTION Concatenate FILE(s) to standard output. With no FILE, or when FILE is -, read standard input. -A, --show-all equivalent to -vET -b, --number-nonblank number nonempty output lines, overrides -n -e equivalent to -vE --More--

When the first page of information returned by man is displayed, the output pauses.

Note: You can output more information one line at a time by pressing the ENTER key or output the next page of the manual by pressing the space bar.

  1. Press Q to exit this manual page.

Now, imagine you’ve remembered there’s a command that prints just the first part of a file, but you can’t remember the exact command. The apropos command is useful in these instances. You can use keywords with apropos to find a command.

  1. Use apropos to find a command that returns the first part of a file:
apropos -a first part file Note: There is no right and wrong when using apropos in terms of keywords. Think of it as a very focused search. It will only return commands that correspond to keywords you supply. Keep trying if the first returned command does not provide what you need. Also, keep in mind that using the -a option will limit results to only those commands that match all keywords supplied.

Click Check my progress to verify that you have completed this task correctly.

Learn more about commands

Task 2. Explore the useradd command

In this task, imagine that you want to set the expiration date for a temporary user account. You know that you need to use the useradd command for this, but you’re not quite sure how to complete the task. You realize it might involve adding an option to the command.

  1. Use the most appropriate Linux command to get help on the useradd command and learn more about all of its options.
Note: You can output more information one line at a time by pressing the ENTER key or output the next page of the manual by pressing the space bar.

  1. Press Q to exit this manual page.

Click Check my progress to verify that you have completed this task correctly.

Explore the useradd command

Task 3. Explore the rm and rmdir commands

In this task, you need to determine the difference between the rm and rmdir commands.

Imagine that you’ve used these commands before, but you can’t remember how they’re different.

  • Use the most appropriate Linux command to quickly remind yourself what each command does.
Note: This task will require entering two commands, one with rm and one with rmdir .

Click Check my progress to verify that you have completed this task correctly.

Explore the rm and rmdir commands

Task 4. Determine which command to use

In this task, imagine that you need to create a new group but you can’t remember what command to use. You need to identify a command that will do this by searching for it through keywords. In this case, use the keywords create new group.

  • Use the most appropriate Linux command with these keywords to identify what command to use.

Click Check my progress to verify that you have completed this task correctly.

Determine which command to use

Conclusion

Great work!

You now have practical experience in using basic Linux Bash shell commands to

  • get a short description of a command,
  • display the man pages for a command, and
  • find commands based on keywords about their function.

This ability will be valuable as you navigate the Linux command line.

End your lab

Before you end the lab, make sure you’re satisfied that you’ve completed all the tasks, and follow these steps:

  1. Click End Lab. A pop-up box will appear. Click Submit to confirm that you're done. Ending the lab will remove your access to the Bash shell. You won’t be able to access the work you've completed in it again.
  2. Another pop-up box will ask you to rate the lab and provide feedback comments. You can complete this if you choose to.
  3. Close the browser tab containing the lab to return to your course.
  4. Refresh the browser tab for the course to mark the lab as complete.

시작하기 전에

  1. 실습에서는 정해진 기간 동안 Google Cloud 프로젝트와 리소스를 만듭니다.
  2. 실습에는 시간 제한이 있으며 일시중지 기능이 없습니다. 실습을 종료하면 처음부터 다시 시작해야 합니다.
  3. 화면 왼쪽 상단에서 실습 시작을 클릭하여 시작합니다.

시크릿 브라우징 사용

  1. 실습에 입력한 사용자 이름비밀번호를 복사합니다.
  2. 비공개 모드에서 콘솔 열기를 클릭합니다.

콘솔에 로그인

    실습 사용자 인증 정보를 사용하여
  1. 로그인합니다. 다른 사용자 인증 정보를 사용하면 오류가 발생하거나 요금이 부과될 수 있습니다.
  2. 약관에 동의하고 리소스 복구 페이지를 건너뜁니다.
  3. 실습을 완료했거나 다시 시작하려고 하는 경우가 아니면 실습 종료를 클릭하지 마세요. 이 버튼을 클릭하면 작업 내용이 지워지고 프로젝트가 삭제됩니다.

현재 이 콘텐츠를 이용할 수 없습니다

이용할 수 있게 되면 이메일로 알려드리겠습니다.

감사합니다

이용할 수 있게 되면 이메일로 알려드리겠습니다.

한 번에 실습 1개만 가능

모든 기존 실습을 종료하고 이 실습을 시작할지 확인하세요.

시크릿 브라우징을 사용하여 실습 실행하기

이 실습을 실행하는 가장 좋은 방법은 시크릿 모드 또는 시크릿 브라우저 창을 사용하는 것입니다. 개인 계정과 학생 계정 간의 충돌로 개인 계정에 추가 요금이 발생하는 일을 방지해 줍니다.