The shell splits your line at each space. The first word is the command: the name of a program. The shell starts that program, and the program writes its output.
In echo hello world, the command is echo. The other words go to the echo program. This is why expr needs spaces: each number and sign must be a separate word.
| Command | Output |
|---|---|
whoami | The username of your account |
hostname | The name of the computer |
When there is no program with that name, the shell tells you, with the word that it received in the middle:
bashwho wrote it: hellothe word it received: command not foundwhat went wrong
Uppercase and lowercase letters are different: whoami is a program, Whoami is not.
- Find out which account you use, and the name of this computer.
- A colleague typed the line below, and it did not work. Run it, read the reply, and find the error.
text
whomai