---
title: Command Line
slug: help/en-us/dairycomp/commandline-overview
docTags: 
createdAt: 2026-01-26T11:43:19.433Z
---

DairyComp allows you to look up data, enter information, and edit settings either through menu selections or through the command line. As shown in the example below, the command line is located toward the top of the window, below the menu and toolbar. You can press the Escape key (ESC) at any time to go straight to the command prompt, or you can click inside of the command line field and start typing a command.

::Image[]{src="https://api.archbee.com/api/optimize/3h8pSJcGUXEi4HGCCYPTA/qelpdpw-RXOeAmKSvPRC6-20260508-195800.png" size="32" width="890" height="431" darkWidth="890" darkHeight="431" position="flex-start" showCaption="false"}

The command line is commonly used to run reports, so we will use a report command to illustrate command structure. A DairyComp report command is made up of the 5 parts defined below.

::Image[]{src="https://api.archbee.com/api/optimize/3h8pSJcGUXEi4HGCCYPTA/1R4NWmCGv9iJHE1GHOETX-20260508-195927.png" size="50" width="1134" height="282" darkWidth="1134" darkHeight="282" position="flex-start" showCaption="false"}

**Review the information below for help creating your report command:**

:::::::WorkflowBlock
::::WorkflowBlockItem
:::ExpandableHeading
### Command Word: Start by typing a command word. Click here to learn more!

The command word tells the system what kind of report you want to run. The following commands are typical for report commands:

| LIST/SHOW/PCT  | EVENTS     |
| -------------- | ---------- |
| COUNT/SUM      | PLOT       |
| GRAPH/EGRAPH   | ECON       |
| BREDSUM        | GUIDE      |
:::
::::

::::::WorkflowBlockItem
:::::ExpandableHeading
### Items: Type the items you want to include in your report. Items define the columns of data you want to see in your report. Click here to learn more!

Follow these guidelines when including items in your command:

- Always include the ID item on reports that need to list animals.
- Insert a space between each item.

:::hint{type="success"}
**TIP:&#x20;**&#x57;hen typing a command, you can press **F1** on your keyboard to see a list of all available items you can use to build your command.
:::

::::ExpandableHeading
**Show me some examples!**

In the command example above, the items are **ID**, **PEN**, **LACT**, **DIM**, **DCC**, and **MILK**:

&#x20;<font color="#EAB308">     </font> <font color="#6b7280"> **&gt;0** **&gt;220** **=0**   **\B2**</font>

This tells the report to include columns for the animal **ID**, pen number (**PEN**), lactation number (**LACT**), days in milk (**DIM**), days carried calf (**DCC**), and last test day milk (**MILK**).

Here are a few examples of items you can use:

| <font color="#f3f4f6">**Item**</font> | <font color="#f3f4f6">**Description**</font>   |
| ------------------------------------- | ---------------------------------------------- |
| ID                                    | The animal's ID number.                        |
| PEN                                   | The animal's current PEN number.               |
| LACT                                  | The animal's current lactation number.         |
| DIM                                   | The animal's current days in milk.             |
| MILK                                  | Pounds of milk the animal last produced.       |
| RPRO                                  | The animal's current reproductive code.        |
| DCC                                   | How many days the animal has carried its calf. |
| DSLH                                  | How many days since the animal's last heat.    |

:::hint{type="success"}
**TIP:&#x20;**&#x52;emember that you can press `F1` to view all available items. The list above only shows several examples.
:::
::::
:::::
::::::

:::::WorkflowBlockItem
::::ExpandableHeading
### Conditions: (Optional) Type any conditions you want to include in your report. Conditions limit your report to specific data. Click here to learn more!

One of the most commonly used condition is the **FOR** condition. To use it, insert the word **FOR** and follow it with instructions that customize (i.e., filter) your report results, such as **FOR** **PEN=4**.

:::ExpandableHeading
**Show me some examples!**

In the command example above, the condition includes the word **FOR**, followed by 3 different conditions to customize the report results — one for lactation number (**LACT**), one for days carried calf (**DCC**), and one for dry date (**DDAT**):

<font color="#6b7280">      </font> <font color="#EAB308"> **&gt;0** **&gt;220** **=0**</font> <font color="#6b7280">  **\B2**</font>

Adding these conditions to your command will narrow your report down to the following results:

- <font color="#67854E">**&gt;0** </font>tells the report to include only animals with a lactation number of 1 or higher.
- <font color="#67854E">**&gt;220**</font> tells the report to include only animals who have carried their calf for more than 220 days.
- <font color="#67854E">**=0**</font> tells the report to include only animals that are currently milking (i.e., a fresh date exists, but DDAT=0 means no dry date exists).

When entering a condition, you can choose from the following operators:

| =   | Equal to                 |
| --- | ------------------------ |
| >   | Greater than             |
| >=  | Greater than or equal to |
| \<  | Less than                |
| \<= | Less than or equal to    |
| \<> | Not equal to             |
:::
::::
:::::

:::::WorkflowBlockItem
::::ExpandableHeading
### Sort: (Optional) Type any sort words (BY and DOWNBY) and criteria to sort how your report results are listed. Click here to learn more!

The sort options are simple. You can use either **BY** or **DOWNBY**:

- Use **BY** to sort lowest to highest.
- Use **DOWNBY** to sort highest to lowest.

:::ExpandableHeading
**Show me some examples!**

The command example above includes the sort command **BY**, followed by the column that will be sorted (PEN):

<font color="#EAB308">        **&gt;0** **&gt;220** **=0**</font> <font color="#EAB308"> </font> <font color="#6b7280">**\B2**</font>

This tells the report to sort the list by the PEN column. It puts the lowest pen number at the top and the highest pen number at the bottom. If you used **DOWNBY** **PEN** instead, it would sort the highest pen number at the top and the lowest pen number at the bottom.
:::
::::
:::::

:::::WorkflowBlockItem
::::ExpandableHeading
### Switches: (Optional) Insert switches at the end of your command to define special tasks and shortcuts. Switches can do a lot for the “look” of reports and the data that is in them. Click here to learn more!

When including a switch in your command, observe these guidelines:

- Precede the list of switches with a **backslash** ( \ ). This is not the slash on the question mark ( ? ) key; it is typically located above the **Enter** key.
- You can include a series of switches together by listing them all after the backslash with no space between them (**\B2A**).
- Use the Switch Manager to see all the available switches for all commands. Click **Command?** at the left side of the command line or navigate to the Help menu to open the Switch Manager, then browse the list of commands and switches.

  For a comprehensive list of commands and switches you can download, see [Command Line Quick Reference Sheets](docId\:ixz_JE7QEBldJwChguOfj).

::Image[]{src="https://api.archbee.com/api/optimize/3h8pSJcGUXEi4HGCCYPTA/pBoZ5o2FD94j-PhIGLlxT-20260508-200430.png" size="32" width="1150" height="736" darkWidth="1150" darkHeight="736" position="flex-start" showCaption="false"}

- Switches work differently for each of the  listed above.
- Switches are typically only a single letter or number.
- Switches are not required; rather, they are available to help you customize your reports.

:::ExpandableHeading
**Show me some examples!**

In the command example above, the switches **\B** and **\2** need to be included, so they are combined as **\B2** at the end of the command:

<font color="#6b7280">        **&gt;0** **&gt;220** **=0**   </font>****<font color="#EAB308">**\B2**</font>

Adding these switches to your command customizes the results as follows:

- The backslash **\\** indicates that one or more switches are included.
- <font color="#67854E">**B**</font> tells the report to include both live and dead animals.
- <font color="#67854E">**2**</font> tells the report to double‑space the results so that it's easier to read.

Some of the most common switches for the LIST and SHOW commands are shown below. Note that other commands have different switches.

| \2  | double space                                     |
| --- | ------------------------------------------------ |
| \A  | averages                                         |
| \B  | both live and dead                               |
| \C  | compress print                                   |
| \D  | dead animals                                     |
| \E  | eject after each sort                            |
| \I  | print descriptions                               |
| \K  | prompts for cows to list                         |
| \Ln | limit number printed on report                   |
| \P  | print in columns                                 |
| \Pn | number of columns to use                         |
| \Q  | prints only total and average no individual info |
| \T  | print totals                                     |
| \U  | print an underline at end of list                |
| \Un | print underline                                  |

For a comprehensive list of commands and switches you can download, see [Command Line Quick Reference Sheets](docId\:BCJOiPrw_ktwi75hWmJOv).
:::
::::
:::::
:::::::

:::hint{type="success"}
**TIP:&#x20;**&#x41;re you new to running reports in the command line? See [Run a Report in the command line](docId\:hTJSQN0TLfIXVwX2CNMrK) for an illustrated tutorial that walks you through creating your first report!
:::

:::hint{type="info"}
**NOTE:&#x20;**&#x46;or help using the command line, try [Assist](docId\:HVprxaRwLtDqTfJrxaJAI), a DairyComp enhancement to the command line that helps you find the command components you need, such as items, events, and more.
:::

See the topics below to learn more:

- [Summary of Commands](docId\:hQQi48YX3EJIkxVI8HBmh)&#x20;
- [Tips for Using the Command Line](docId\:i0uElt2iq6IHcT6Lh7_Mc)&#x20;
- [Assist](docId\:HVprxaRwLtDqTfJrxaJAI)&#x20;
- [Advanced Syntax Options](docId\:XPMSBmqgB64XtWgFlWc2w)&#x20;

:::ExpandableHeading
## Related Topics

- [Troubleshoot the Command Line](docId\:SSOf7vqpmQN8mhbhnwmHQ)
:::

***

