0% found this document useful (0 votes)
38 views

Practicas Cap 3

This document provides instructions for logging into a Linux system using both text and graphical terminals, and demonstrates basic Linux commands. It instructs the user to: 1) Log into the first terminal as a regular user, the second as root, and the seventh graphically. 2) Perform commands like changing passwords, viewing dates, clearing screens. 3) Learn keyboard shortcuts for command history and completion. It concludes by showing how to log off all users.

Uploaded by

William Villa
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views

Practicas Cap 3

This document provides instructions for logging into a Linux system using both text and graphical terminals, and demonstrates basic Linux commands. It instructs the user to: 1) Log into the first terminal as a regular user, the second as root, and the seventh graphically. 2) Perform commands like changing passwords, viewing dates, clearing screens. 3) Learn keyboard shortcuts for command history and completion. It concludes by showing how to log off all users.

Uploaded by

William Villa
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Práctica No.

1
COMANDOS BASICOS

Logging in on a virtual terminal


In this section you are going to log in to the system using both text and graphical virtual terminals.

__ 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.

__ 8. Display the system's date.


» $ date

__ 9. Display the whole calendar for the year 2004.


» $ cal 2004

__ 10. Display the month of January for the year 1999 and 99. Are 1999 and 99 the same?
» $ cal 1 1999
» $ cal 1 99

__ 11. Generate a list of all users present on your system.


» $ who
- OR -
» $ finger

__ 12. Display your login name.


» $ whoami
- OR -
» $ who am i

__ 13. Display the login information of your own user account, and of root.
» $ finger <username>
» $ finger root

__ 14. Clear your screen.


» $ clear

__ 15. Print the text Out to lunch on your display.


» $ echo Out to lunch

__ 16. Make sure you are willing to receive messages


» $ mesg y

__ 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>

Keyboard and Mouse Tips

__ 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.

Using the history

__ 23. Use the history command to view the last 20 commands you typed.
» $ history 20

__ 24. Execute one of the commands from the history list


» $ !2

__ 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

You might also like