LPIC 1 LAB CH 1 - Performing Basic Linux Tasks
LPIC 1 LAB CH 1 - Performing Basic Linux Tasks
The name of the file or folder is on the right. The last modified date and time is to the left of
the name, and to the left of that is the size of the file or folder (in bytes). Most of the other
fields relate to permissions and ownership.
c) Enter su - root
d) At the Password prompt, enter Cnctc@2022
e) Verify that your prompt has changed to [root@localhost ~]#
You are now logged in as the root user, the user with the highest level of privileges
(superuser).
f) Enter cat /var/log/boot.log and verify that you can now read the file.
g) Enter exit to log out as root and log back in to your regular student account.
2. Look for a command that could help you search the contents of a text file.
a) Enter apropos search
b) Verify that multiple commands are listed in the output, each of which includes the
c) term "search" in its name or brief description.
d) You could try to pick out the appropriate command from these results, but changing your
search might narrow them down.
e) Enter clear to clear the screen.
f) Enter apropos pattern
g) Verify that you receive fewer results
3. Looking at these results, which command(s) do you think would best fulfill the capabilities
that you're looking for?
Answers may vary, but one of the grep variants is likely the most appropriate command. The
awk command and its variants could be helpful, but appear to be more advanced.
4. Read the manual page for a command that could be what you're looking for.
a) Enter man grep
b) Verify that you see the manual page for the grep command.
c) Read the SYNOPSIS section to understand how to use the command.
d) Read the DESCRIPTION section to understand what the command does.
e) Navigate up and down the man page using the same keys as the less command.
f) Enter /case to search the man page for the term "case".
g) Press n to navigate to the next instance of the search term.
h) When you're at the end of the man page, press Shift+N to navigate to the previous instance
of the search term.
i) Read the description for the command option that has to do with case.
5. Given what you've read in the man page for grep so far, answer what youthink the
following command does: grep -i hello myfile
This command will return any lines in the file myfile that contain the text "hello", no matter
what case the text is in (case insensitive).
7. How confident are you that this command fulfills what you're looking for?
Answers may vary, but the grep command does generally meet your requirements.
However, this doesn't mean it's the only command, or the best command, for the job.
8. You still want to learn more about other commands that your team could use to search
the contents of a text file. Aside from the help options built into Linux, what other sources
can you consult in your research?
Answers may vary, but there is a wide variety of useful sources on the Internet that could
help you find what you're looking for. You could pose specific answers to Q&A sites like Stack
Exchange; ask discussion questions on newsgroups, mailing lists, and forums dedicated to
Linux support; consult supplementary and/or advanced documentation through a resource
like the Linux Documentation Project; or consult distro-specific documentation on the
relevant distro's website