Skip to content

Development Environment / Windows Commands

This documentation provides a summary of useful Windows commands that may be used during StateMod development.


Introduction

The StateMod development environment generally uses MinGW, which provides a Linux environment within Windows desktop. See the Linux Commands documentation. However, the Windows command shell may be for some tasks.

Batch and Command Files

The StateMod development environment makes use of Windows batch (.bat) and (.cmd) files. Command and batch files are generally interchangable, but the cmd extension is preferred when working with the Windows cmd command prompt (shell) program.

Files to run are located by checking the PATH environment variable. This concept is similar on Windows and Linux. To display the PATH, type:

echo %PATH%

or, to see all environment variables:

set

If a program file to be run is not found in the PATH, it can be run by typing the relative or absolute path to the file. Unlike Linux, Windows includes the current folder in the path by default.

Windows Command Summary

The following table lists common commands that may be used in a cmd shell during development. Some commands are built into the shell program and others are separate programs. Windows provides many commands to perform common tasks. Commands sometimes operate on more than one file, specified as multiple file separated by spaces or use * as wildcard in names. Click on the command name below for additional documentation. Some commands, such as cygpath are only available if MinGW or Git Bash are installed, and may not be in the normal PATH folders.

Windows Programs used in the StateMod Development Environment

Windows Command Similar in Linux Description
cd cd Change directory (folder), for example:
  • cd - show the current folder (similar to Linux pwd)
  • cd folder - change to the specified folder
  • cd .. - change to the parent folder of the current folder
  • cd ../.. - change up two folder levels
cls clear Clear the terminal of output, useful when want to start a clean sequence of commands.
cygpath cygpath Convert between Linux and Windows file paths, for example:
  • cygpath -w ~ - print the Windows location of Linux user's home folder
  • cygpath -w /some/path - print the Windows location of a Linux folder
del rm Remove one or more files, for example: del *.log
dir ls List files:
  • dir - list all files
  • dir *.txt - list all files with extension txt
mkdir mkdir Make a new directory (folder), for example: mkdir newfolder
rmdir rmdir Remove one or more directories (folders), for example: rmdir folder
type cat Print the contents of a file, for example: type filenme
where which Find where a program exists on the system by searching the PATH environment variable, for example: which gfortran