Practicas Cap 3
Practicas Cap 3
1
COMANDOS BASICOS
__ 1. If the install went correctly then you should now see a graphical login rompt. If this is not the case, ask
your instructor to fix this. (You will learn how to do this yourself later in the course.)
__ 2. Verify that you indeed have seven different virtual terminals. Cycle through them by pressing Alt-Fn,
where n is the terminal number you want to access. Use Ctrl-Alt-Fn when you are in a graphical terminal.
» <Ctrl-Alt-F1>
» <Alt-F2>
» <Alt-F3>
» <Alt-F4>
» <Alt-F5>
» <Alt-F6>
» <Alt-F7>
__ 3. In your first virtual terminal (tty1), log in to the system with your own username which you also
configured when installing the system.
» <Alt-F1>
» Login: (your username)
» Password: (your password)
__ 4. In your second virtual terminal (tty2), log in to the system as root. After having logged in, look at the
command prompt. Do you notice anything different from the command prompt in the other virtual terminals?
» <Alt-F2>
» Login: root
» Password: maestria
__ 5. In your seventh virtual terminal (tty7), log in to the system with your own username and password.
» Login: (your username)
» Password: (your password)
__ 6. Open a terminal window. Take a look at the command prompt. Does it differ from the command
prompt on tty1? Why or why not?
» On a Fedora or Red Hat system, a terminal window can be started from the “Red Hat” button in the
lower left hand corner; System Tools; Terminal. You can also drag this icon to your quick launch bar,
if you want to.
Basic Commands
In this section we are going to execute some basic commands, in order to familiarize yourself with the
command syntax of Linux, and the fact that you are currently on a multi-user, multi-tasking system.
All commands in this section are executed on virtual terminal seven (the graphical login prompt where you
are logged in as yourself), using the terminal window you just opened, unless specified otherwise.
__ 7. Change your password. Memorize this password because no one can find out your password if you
forget it.
» $ passwd
» Changing password for <username>
» (current) UNIX password: (your current password)
» New UNIX password: (your new password)
» Retype new UNIX password: (your new password)
» passwd: all authentication tokens updated successfully.
__ 10. Display the month of January for the year 1999 and 99. Are 1999 and 99 the same?
» $ cal 1 1999
» $ cal 1 99
__ 13. Display the login information of your own user account, and of root.
» $ finger <username>
» $ finger root
__ 17.Write the message Out to lunch to the display of root. Check whether root got the message.
» $ write root
» Out to lunch
» <Ctrl-D>
» <Ctrl-Alt-F2>
» <Alt-F7>
__ 18.Write the message Out to lunch to the display of all users. Check whether everybody on your system
got the message.
» $ wall
» Out to lunch
» <Ctrl-D>
» <Ctrl-Alt-F1>
» <Alt-F2>
» <Alt-F7>
__ 19. The bash shell has a command history function. View some of the commands you have entered. Try
to alter one of these commands, then run the command again.
» <arrow up>
» <arrow down>
__ 20. Your terminal has a buffer that keeps track of the output of your commands. View the output of the
previous commands.
» <shift page-up>
» <shift page-down>
__ 21. Bash supports command and filename completion with the TAB character. Try to
use this feature, both on commands and on filenames.
» $ pass<TAB>
» $ cat /etc/pass<TAB>
__ 22. Both in a text terminal and an emulated terminal in the graphical desktop, try to re-execute
commands by scrolling up a little, selecting the command with the left mouse button, and then pasting it
onto the same terminal again with the middle mouse button.
Also try this across different text and graphical terminals.
__ 23. Use the history command to view the last 20 commands you typed.
» $ history 20
__ 25. Execute the echo command again, this time changing the word “lunch” to “dinner”.
» $ !echo:s/lunch/dinner/
__ 26. Bash also supports searching in the history. Try this feature as well.
» $ <Ctrl-R>cle
Logging off
__ 30. Log off all users that are logged in at any TTY.
» <Ctrl-Alt-F1>
» $ exit
» <Alt-F2>
» $ logout
» <Alt-F7>
» Click on the GNOME or KDE button and select “Log out”
END OF EXERCISE