Get started by opening your terminal app. Whenever you see a
$ this is the start of a command that we will be entering into the terminal, You do not need to enter the
$ into the terminal. If you see a line that does not start with
$ it is an example response to the command entered. Every unix command is executed by pressing the enter key.
Display the date and time
date command tells the system to print (output) the date and time.
- The day of the week
- The day of the month
- The month
- The year
- The time in 24 hour format
- The timezone of the system
Display which users are logged in
who command displays information about all the users currently logged into the system.
In this example we can see three users are logged in.
holly. Along with each user we also get :
- The time and date the user logged
tty number is a unique identification number each user is given by the Unix system.
who command can also be used to get information about yourself:
who am i and
who are actually just one command -
who. When we use
who am i we are just giving the
who command extra information. These extra pieces of information are called arguments.
am is one argument
i is another.
The echo command prints anything you type on the same line.
In the second example you will see the additional spaces are removed. This is typical of the Unix system. The words are important the space between them are only required to show that they are separate.