🎓 A1Learner
🔍
0 of 50 lessons completed

Your First Commands

Your first commands ask the shell for simple facts about this machine. Each one prints one short answer.

Your name

The answer is a single word.

$ whoami

This machine

The answer is a single name.

$ hostname

Today

The answer names the day, the date, and the time.

$ date

Past commands

The list shows four past lines, oldest first.

$ history

Example

$ whoami
$ hostname
$ date

Key points

  • A user is the person at the computer.
  • Use whoami to print the name of the current user.
  • Use hostname to print the hostname, the name of this machine.
  • Use date to print the current date and time.
  • Use history to print the history, a list of past commands in order.
  • A home is where one user keeps their own work.

In this example, three lines ask three facts. The first line gives the name root. The second line gives the name htch-runtime. The third line gives the date and time. Each answer comes from this machine.

Note

The answers in this lesson differ on each machine, so your answers will differ from the ones shown here.

Try it Yourself

Edit the code, then press Run.

Running is simulated

Exercise

What does whoami print?