The Terminal
A terminal is a screen that takes typed lines and shows answers back. A shell is the program inside the terminal that reads each line and runs it.
Say hello
Echo prints the word after it.
$ echo HelloSay more than one word
Echo prints each word in order.
$ echo Hello LinuxEcho does not add
Echo prints 2 + 2 as words, not as a sum.
$ echo 2 + 2Example
$ echo Hello
$ echo Hello Linux
$ echo 2 + 2Key points
- A terminal is a screen for typed lines and printed answers.
- A shell is a program that reads a command and runs it.
- A command is one typed line that asks the shell to do one task.
- A prompt is the mark that shows the shell is ready for a new command.
- The prompt in this course is a dollar sign followed by a space.
- Use echo to print words back on the screen.
- Echo prints the words after it, in the same order.
In this example, echo prints three lines. The first line prints one word. The second line prints two words in order. The third line prints 2 + 2 as words. Echo never works out a sum.
Note
Echo prints words as words. It does not add them up.
Try it Yourself
Edit the code, then press Run.
Running is simulated
Exercise
What does echo do?