.. highlight:: console .. role:: bash(code) :language: bash :class: highlight Getting started --------------- echo ~~~~ Let's start with the traditional computer science greeting. Type the following line after the :dfn:`prompt` :kbd:`$` in your terminal:: $ echo Hello World Right beneath your input line you should see:: Hello World In the line you typed, :command:`echo` is the :dfn:`command`, anything that follows are the :dfn:`arguments`. The command and each argument are separated by spaces. Arguments that contain a whitespace internally can be quoted with :kbd:`""`, allowing us to pass a single argument to :command:`echo`, where we passed two arguments before:: $ echo "Hello World" Hello World It makes no difference here, but will become important when dealing e.g. with whitespaces in filenames. Compare the output you get from the following commands:: $ echo "Hello \n World" Hello \n World $ echo -e "Hello \n World" Hello World The argument :option:`-e` has modified the behaviour of :command:`echo`. By convention, arguments that begin with :kbd:`-` or :kbd:`--` are used to modify the behaviour of a command, they are called command line :dfn:`options` or :dfn:`switches`. After looking at the next section, come back here and try out other :kbd:`\\...` combinations with :option:`-e`. .. note:: We'll not mention this explicitly again, but you should always go back over previous commands and try to use what you have found out later on. It is possible to race through the examples in a few minutes, but you'll learn a lot more if you spend time exploring! man ~~~ To find out what happened there with the :option:`-e` switch, we can look at the manual pages for :command:`echo`:: $ man echo To exit the manual page, press :kbd:`q`. Most commands have a :dfn:`man page`, and they always follow the same layout: a short statement about the command on top, then a summary showing required and optional arguments, followed by a list of the switches. Man pages for more complicated commands will also include examples of common situations. Man pages contain a lot of information, you do *not* have to understand all of it to find what you need! Now try out some of the options of :command:`echo`. Always take a look at the man pages for the commands we introduce from now on, such as :command:`man` itself:: $ man man