Activity: Get help in the command line

Lab 1 Stunde universal_currency_alt Keine Kosten show_chart Einsteiger
info Dieses Lab kann KI-Tools enthalten, die den Lernprozess unterstützen.
Dieser Inhalt ist noch nicht für Mobilgeräte optimiert.
Die Lernumgebung funktioniert am besten, wenn Sie auf einem Computer über einen per E‑Mail gesendeten Link darauf zugreifen.

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.

Vorbereitung

  1. Labs erstellen ein Google Cloud-Projekt und Ressourcen für einen bestimmten Zeitraum
  2. Labs haben ein Zeitlimit und keine Pausenfunktion. Wenn Sie das Lab beenden, müssen Sie von vorne beginnen.
  3. Klicken Sie links oben auf dem Bildschirm auf Lab starten, um zu beginnen

Privates Surfen verwenden

  1. Kopieren Sie den bereitgestellten Nutzernamen und das Passwort für das Lab
  2. Klicken Sie im privaten Modus auf Konsole öffnen

In der Konsole anmelden

  1. Melden Sie sich mit Ihren Lab-Anmeldedaten an. Wenn Sie andere Anmeldedaten verwenden, kann dies zu Fehlern führen oder es fallen Kosten an.
  2. Akzeptieren Sie die Nutzungsbedingungen und überspringen Sie die Seite zur Wiederherstellung der Ressourcen
  3. Klicken Sie erst auf Lab beenden, wenn Sie das Lab abgeschlossen haben oder es neu starten möchten. Andernfalls werden Ihre bisherige Arbeit und das Projekt gelöscht.

Diese Inhalte sind derzeit nicht verfügbar

Bei Verfügbarkeit des Labs benachrichtigen wir Sie per E-Mail

Sehr gut!

Bei Verfügbarkeit kontaktieren wir Sie per E-Mail

Es ist immer nur ein Lab möglich

Bestätigen Sie, dass Sie alle vorhandenen Labs beenden und dieses Lab starten möchten

Privates Surfen für das Lab verwenden

Am besten führen Sie dieses Lab in einem Inkognito- oder privaten Browserfenster aus. So vermeiden Sie Konflikte zwischen Ihrem privaten Konto und dem Teilnehmerkonto, die zusätzliche Kosten für Ihr privates Konto verursachen könnten.