M04 - Part 1 Hands-On Assignment - Linux Command Line Exercises - Shaker Mohammadtom
M04 - Part 1 Hands-On Assignment - Linux Command Line Exercises - Shaker Mohammadtom
lOMoARcPSD|7891473
*** For this lab you can choose to use the virtual machines you build in the M01 –
Part 2: hands On Project – Building a Virtual Machine or you can use the machines you
built in AWS. If you choose the use the machines you built in AWS you will use the Red
Hat instance where the lab calls for Fedora and the Ubuntu Instance where the lab calls
for Mint***
9. At the prompt, type date and press Enter. You should see the date and time (or at
least what the computer thinks the date and time is currently), and then another
command line prompt.
10. Press the Ctrl key and hold it; meanwhile press the Alt key and hold it; and then
pressthe F3 key. Release all three keys. You should see a new screen. This is a
virtual console terminal login screen.
11. Type in the regular username you recorded in step #8, and press Enter.
12. Type in the password you used in step #3, and press Enter. Note, you will not see
any helpful characters like asterisks or dots as you type in the password.
13. Once you have successfully logged in, you should see a command line prompt,
similar to the one you received in step #7.
14. At the prompt, type whoami and press Enter. Does the displayed name match the
one you recorded in step #8? It should.
15. At the prompt, type date and press Enter. You should see the date and time (or at
least what the computer thinks the date and time is currently).
Exercise 5.b: Accessing the Command Line in Linux Mint (Objective 2.1)
7. At the prompt, type date and press Enter. You should see the date and time (or at
least what the computer thinks the date and time is currently), and then another
command line prompt.
8. Press the Ctrl+Alt+F2 key sequence. You should see a new screen. This is a virtual
console terminal login screen.
11. Type in the regular username you recorded in step #6, and press Enter.
12. Type in the password you used in step #3. Note, you will not see any helpful
characters like asterisks or dots as you type in the password.
13. Once you have successfully logged in, you should see a command line prompt,
similar to the one you received in step #5.
14. At the prompt, type whoami and press Enter. Does the displayed name match the
one you recorded in step #6? It should.
Continued on the next page
6. Games
7. Miscellaneous
9. Kernel routines
16. The man pages all live in the /usr/share/man/ directory. You can see the
different man page sections and miscellaneous files located here by typing: ls
/usr/share/man/ and pressing Enter. Notice the man1 and man2 files. These are
actually directories that contain the various man pages.
17. You can find the various files with the name “uname” that may be associated with the
uname command, including the man pages. Try this out, by typing: whereis
uname and pressing Enter. The output is not very easy to read, because it’s not
formatted nicely. The whereis command searches particular directories to find
files associated with the name you give it.
18. Try out the command you have been getting help on by typing uname and pressing
Enter. The uname command provides system information.
19. You get a lot more system information, including the Linux kernel's version number
bytyping uname -a and pressing Enter.
20. One more source of documentation is the directory /usr/share/doc. Take a
look at this directory by typing: ls /usr/share/doc and pressing Enter. Nothing too
exciting here, but you should be aware of this directory if you are searching for
documentation on your Linux system.
21. Take a look at a specific documentation file, by typing in the command: less
/usr/share/doc/bash/copyright and pressing Enter. This shows you the GPL license
for this bash shell! You read about the various licenses in Chapter 2. Some
distributions name this file COPYING. The /usr/share/doc directory has
miscellaneous documentation, such as various products’ licenses.
lOMoARcPSD|7891473
22. Press Enter a few times to read through the license document, and then type q to quit
and return to the prompt.
5. Here's an interesting little trick: Type !! and press Enter. You should see that the
Bash shell "re-issued" the command from the step above. The !! command "pulls
out" the last command you did from your command history; displays the command;
and runs it again.
Continued on next page
9. Pick one of the commands from the history list and note its number. Type !# (where
# is the number of the command in your history) and press Enter. The command
should display and execute! This is another method, besides the up arrow key, you
can use to recall previous commands.