The console, first commands in UNIX

This name usually identifies the screen, the keyboard and the mouse that are directly connected to the system. For security reasons, the console is not usually accessible to any user, its use being reserved to the system administrator.

The console, first commands in UNIX | Websites Management | This name usually identifies the screen, the keyboard and the mouse that are directly connected to the system. For security reasons, the console is not usually accessible to any user, its use being reserved to the system administrator

There is a special mention of a particular terminal present in all UNIX systems: la consola.

Usually this name identifies the screen, the keyboard and the mouse that are directly connected to the system. For security reasons, the console is not usually accessible to any user, its use being reserved to the system administrator.

If you have a computer with Linux in your home or your workplace, the console is formed by the screen and the keyboard of your computer.

Like the rest of the terminals, the console can be graphic or text and can be used like any other terminal. Its usefulness lies in the fact that it also allows certain administration and system management tasks that can not be carried out from other terminals.

SAVE TIME: Linux has several virtual consoles by default. By pressing ALT and the function keys (ALT + F1, ..., ALT + F6) you can select one of the six available virtual consoles and work on it as if it were a current terminal. This will allow you to maintain several sessions simultaneously. This feature is available only in the system console.

First commands. Changing the password

Whatever method you use to access your system at this point, you will have already obtained the command line indicator that will allow you to type your first UNIX commands. This could be the following:

$

The blinking cursor to the right of the '$' indicates that the system is waiting for your orders. Type eg date and press the Enter key.

$ date
Web 5 10:40:03 MET 2014
$

Congratulations! You have just run your first UNIX command. As you can see, date shows you the current date and time. It's not bad as I start.

As a next step you can try to change your password. No one else should know your password, not even the system administrator. For this reason it is a good idea to change it the first time you access the system.

To change your password just use the passwd command. The system will ask you to enter, as a security measure, your old password.

In case you enter it wrong it will not allow you to change it. This prevents any stranger that has entered your account (for example, because you forgot to close it) can change the key at will.

If all goes well, the system will ask for the new password and then ask you to type it again to make sure you have not made a mistake in doing so. If that were the case, the change would not occur. For example:

$passwd
Changing password for user akus
Enter old password:
Enter new password:
Re-type new password:
Password changed.
$

Passwords are not displayed on the screen to prevent someone from copying it.

You should know that certain systems will not allow you to enter any password and that you can only enter those that fit with certain specifications, such as a minimum number of characters or the presence of a numerical digit.

Some simple commands

Now that you have made sure that no one knows your password, you may want to try some more useful commands that you will frequently use as a new UNIX user.

First of all, keep in mind that UNIX distinguishes uppercase letters from lowercase letters and that commands are always written in lowercase letters.

The date command, as you have already seen, will allow you to know the current time and date of the system, although sometimes it does not coincide with the actual date and time.

cal displays a calendar on the terminal screen. If it is executed without arguments it will show the calendar for the current year. If you want to see the calendar for a different year, you just have to specify it. For example, to see the 2015 calendar type 2015 cal.

If you want to see only one month you can specify it by giving your number between 1 and 12. For example, the month of May 1985:

$ cal 05 1985

The uptime and ruptime commands allow you to know information about the UNIX system machines to which it connects.

Thus, uptime shows how long the machine to which it has been connected has been turned on. If you run it you will see something like this:

00:55:44 up 2 days, 7:26, 2 users, load average: 0,13, 0,05, 0,00

That is, the computer has been running for 2 days, 7 hours and 26 minutes and there are 2 users connected.

The last three numbers show the number of programs that have been waiting to be executed as a measure at the last minute, in the last five minutes and in the last quarter hour, respectively.

These numbers provide an approximate measure of the system load.

If you want to see the information of all the UNIX machines in your local network, execute the ruptime command, which will show a line like the one for each machine in the network.

UNIX is a multi-user system, which means that at a certain moment there can be several different users executing tasks in the system.

The who command lets you know which users are connected at that moment:

akus@akus-System-Product-Name:~$ who
akus      tty7        2014-01-11 09:44 (:0)
joel        ttyp2     2014-01-11 (unive.tel.net)

The name of the user, the identifier of the terminal from which it is connected, the date and time it was connected, and, if it is a network connection, the place from which it was connected are indicated on each line.

We have already indicated that all accesses to the system are made from terminals. That's why each user has a terminal associated.

The w command is very similar to who, although it allows to obtain some more data:

akus@akus-System-Product-Name:~$ w
 10:21:36 up 37 min,  2 users,  load average: 0,38, 0,39, 0,45
USUARIO  TTY      DE               LOGIN@   IDLE   JCPU   PCPU WHAT
akus     tty7     :0               09:44   37:12   1:57   0.18s gnome-session -
joel     ttyp2    :0.0      unive.tel.net       10:09    telnet

On the first line You can see the same information that is obtained through the update command.

The first four fields relating to each user indicate, respectively, their name, the connection terminal, the remote computer from which they were connected if it is a network connection and the start time of the session.

The IDLE field (inactive) indicates the user's idle time in minutes. A user is considered to be inactive when he does not press a key on the terminal.

The fields of JCPU and PCPU indicate a measure of the time consumed by the tasks that the user is executing. As UNIX is a multi-tasking system, each user can have several processes at the same time.

The last field, what, lets you know what the user is doing now.

Another interesting order is whoami (Who Am I ?, Who am I?). When typing this order from a session you can know what user it belongs to:

akus@akus-System-Product-Name:~$ whoami
akus

Surely you will wonder what utility such a simple order can have, if you already know which user it is. The answer is simple: it is very easy to leave an open session in a terminal due to forgetfulness.

In this case, whoami will allow whoever finds it to know which user it belongs to. It is also common to have several accounts in the same system. If in a case you do not remember which one you used to connect the whoami command will help you solve the problem.

Exiting the system

Now that you have tried some commands and are beginning to become familiar with UNIX you should also know how your session ends. There are several ways to carry it out.

The first one is press CTRL + D. When you do this you will be sending a signal called end of files (EOF, End of file). The shell will understand that it will not send more data, it will end, and UNIX will close the session.

In some shell it is necessary to specify that this key combination must produce this result. This prevents an accidental press from closing the session. For this reason it is possible that when pressing CTRL + D the system will respond:

Use “logout” to logout.
O bien
Use “exit” to logout

In this case you must type logout or exit to exit. In any case, the exit command will allow you to close the session.

Never leave an open connection.

If he did, someone could unlawfully use his account and, for example, delete his data or take his identity by sending "unpleasant" emails to other users.

It is not enough to turn off the terminal, as this usually does not close the session and in the best of cases some processes will remain in the system consuming resources.

In fact, depending on the type of terminal, you can simply turn it back on to continue the interrupted session.

Caution: If you are working from the console on a Linux system do not forget to close all open sessions on the virtual consoles. Check them before leaving.

If you connected from a graphic terminal you must also close the window system session. Usually it would be enough to click with the mouse the appropriate icon.

In other cases, it is necessary to click with the right mouse button on the bottom of the screen, which displays a menu with several options from which you can select the output option.

Did you like it or was it useful?

Help us share it in Social Networks

Professor at the University of Guadalajara

Hugo Delgado Desarrollador y Diseñador Web en Puerto Vallarta

Professional in Web Development and SEO Positioning for more than 10 continuous years.
We have more than 200 certificates and recognitions in the Academic and Professional trajectory, including diploma certificates certified by Google.

IT ALSO DESERVES TO PAY TO VISIT:

Not finding what you need?

Use our internal search to discover more information
Sponsored content:
 

Leave your Comment

SPONSOR

Your business can also appear here. More information