Command Line

2025/12/27

Type
Learning Resource
Format
Glossary Article
Version
General
Subject Tags
Code
Assets
All else
Copyright 2016-2026, GDQuest
Created
2026/02/16
Updated
2025/12/27

Command Line

Learning to use the command line is not urgent: you can do a lot without ever touching it. But in your dev journey, it's almost impossible to imagine that you will never have to do a bit of command line work.

You will use the command line to process files, export games automatically, reduce images, and so on.

The command line is a text interface for your computer. It's how computers used to be controlled, and it's still the interface of choice for many operations.

There are a few excellent benefits to a text interface. Firstly, instructions. Instead of telling people to click here, click there, do this, do that, you can give them the instruction, and they can copy-paste it. Secondly, you can have many options in a text-based interface, where it would be overwhelming in a UI. Finally, command line programs are composable. Using GUIs, you can export an image from a program and put it in another, but using the command line, you can directly connect them in one command.

The command line is a bit like a programming language. You have commands, options, and arguments. You can use something called "pipes" to connect commands, and you can use redirection to send the output of a command to a file.

To use the command line, we use something called a "terminal emulator". It's an emulator because it emulates the old terminals that were used to control computers. On Windows, they call it "Command Prompt". Emulators run various programs called "shells". Shells are sort of like different programming languages. They all work kind of like each other, with some differences.

Basics of Shells

Practically all shells have the same few concepts. When you open one, you see a prompt. It's a bit like a cursor in a text editor. It shows you where you can type. You type a command, and you press enter. The shell runs the command, and it shows you the output. If the command is successful, it shows you a new prompt.

The default Bash prompt (on Linux and Mac) is often:


[name@host ~]$

Where "name" is your username, and "host" is the computer's name.

On Windows, the prompt is like this:


c:/>

To navigate in directories, you use the cd command, or "change directory". cd my_dir will make my_dir the directory you're in. You can use relative paths, or absolute paths from the root.

To go back one directory, you can use cd ... To list the files in a directory, you can use the ls command. On Windows, you can use dir.

To run a program, you can type the name of the program. If the program is in the current directory, you can type ./program_name. Otherwise, you need to call it from its location, like so:


[name@host ~]$ /home/user/program_name

Or, on Windows:


c:/> C:\Users\user\program_name.exe

Some programs are in your PATH. Any directory added to your PATH is globally accessible. To add programs to your path, check the documentation for your operating system and shell.

It's a good idea to add Godot to your PATH if you want to be able to use it from the command line.

Each program can do whatever it wants, but there are some conventions that most programs try to follow:

Become an Indie Gamedev with GDQuest!

Don't stop here. Step-by-step tutorials are fun but they only take you so far.

Try one of our proven study programs to become an independent Gamedev truly capable of realizing the games you’ve always wanted to make.

Nathan

Founder and teacher at GDQuest
  • Starter Kit
  • Learn Gamedev from Zero
Check out GDSchool

You're welcome in our little community

Get help from peers and pros on GDQuest's Discord server!

20,000 membersJoin Server

Contribute to GDQuest's Free Library

There are multiple ways you can join our effort to create free and open source gamedev resources that are accessible to everyone!