### 2.2 Running LilyPond

In the last section we explained what kind of things you could enter in a LilyPond file. In this section we will explain what commands to run and how to view or print the output. If you have not used LilyPond before, want to test your setup, or want to run an example file yourself, read this section. The instructions that follow are for Unix-like systems. Some additional instructions for Microsoft Windows are given at the end of this section.

Begin by opening a terminal window and starting a text editor. For example, you could open an xterm and execute `joe` 1. In your text editor, enter the following input and save the file as test.ly

         \score {
           \notes { c'4 e' g' }
         }

To process test.ly, proceed as follows

         lilypond test.ly

You will see something resembling

         GNU LilyPond 1.8.0
         Now processing: `/home/fred/ly/test.ly'
         Parsing...
         Interpreting music...[1]
           ...  more interesting stuff ...
         PDF output to `test.pdf'...
         DVI output to `test.dvi'...

The result is the file test.pdf 2 which you can print or with the standard facilities of your operating system.3

On Windows, start up a text-editor4 and enter

         \score {
           \notes { c'4 e' g' }
         }

Save it on the desktop as test.ly and make sure that it is not called test.ly.TXT. Double clicking test.ly will process the file and show the resulting PDF file.

#### Footnotes

[1] There are macro files for VIM addicts, and there is a `LilyPond-mode` for Emacs addicts. If it has not been installed already, refer to the file INSTALL.txt

[2] For TeX aficionados: there is also a test.dvi file. It can be viewed with `xdvi`. The DVI uses a lot of PostScript specials, which do not show up in the magnifying glass. The specials also mean that the DVI file cannot be processed with `dvilj`. Use `dvips` for printing.

[3] If your system does not have any tools installed, you can try http://www.cs.wisc.edu/~ghost/, a freely available package for viewing and printing PDF and PostScript files.

[4] Any simple or programmer-oriented editor will do, for example Notepad. Do not use a word processor, its formatting codes will confuse LilyPond

Read comments on this page, or add one. This page is for LilyPond-2.2.5 (stable-branch).