While many modern applications offer graphical user interfaces (GUIs) for interaction, the command line interface (CLI), often called the "terminal" or "shell," remains a fundamental tool for developers and increasingly for users interacting with more advanced software, including some local Large Language Model tools. Understanding its basics can significantly streamline the setup and management process described in this chapter.
Think of the command line as a text-based conversation with your computer. Instead of clicking icons and menus, you type specific commands, and the computer responds with text output or by performing an action. While it might seem intimidating initially, learning a few basic commands provides direct and powerful control over your system.
For running local LLMs, familiarity with the command line is beneficial for several reasons:
llama.cpp
), and supporting software (like Python and its packages) are installed or managed using command-line instructions. Tools like Ollama heavily rely on it for downloading and running models initially.Even if you plan to primarily use GUI tools like LM Studio, encountering command-line instructions during setup or troubleshooting is common.
Accessing the command line varies slightly depending on your operating system:
cmd
or "Command Prompt" in the Start menu.PowerShell
in the Start menu. It's a more modern and powerful alternative to Command Prompt.Applications
> Utilities
folder and double-click Terminal.app
.Terminal
, then press Enter.Once opened, you'll typically see a window with a blinking cursor next to something called a prompt. The prompt indicates the system is ready to receive your command. It often shows your username, the computer's name (hostname), and your current location (directory) in the file system, like C:\Users\YourName>
on Windows or username@hostname:~$
on macOS/Linux.
Interacting with the terminal involves typing a command and pressing Enter. Commands are simply the names of programs or built-in shell functions.
cd
, ls
, ollama
).-
) or double hyphen (--
) (e.g., ls -l
to show a detailed list).One of the most fundamental concepts is navigating the file system. Your computer organizes files in directories (folders).
pwd
(Print Working Directory): On macOS and Linux, this command tells you your current directory location. (On Windows Command Prompt, the prompt itself usually shows the path, or you can type cd
without arguments).ls
(List): On macOS and Linux, this lists the files and directories within your current directory.
ls
dir
(Directory): On Windows Command Prompt, this lists the files and directories.
dir
cd
(Change Directory): This command allows you to move into a different directory. You provide the path to the directory as an argument.
cd Documents
(moves into the Documents
subdirectory)cd Documents
cd ..
(The ..
represents the parent directory)Let's try a quick example. Open your terminal and type the command to list files in your current directory (ls
for macOS/Linux, dir
for Windows), then press Enter.
# On macOS or Linux
ls
:: On Windows Command Prompt
dir
You should see a list of files and folders printed to the screen. Now try changing into a directory, for example, your Documents directory (assuming it exists directly within your current location):
# On macOS or Linux
cd Documents
pwd # Confirm your location changed
ls # List files in Documents
:: On Windows Command Prompt
cd Documents
cd # Confirm your location changed (prints the current path)
dir # List files in Documents
Don't worry if this seems unfamiliar. For this course, you won't need to become a command-line expert. We will provide the specific commands needed for tasks like installing Ollama or Python. The goal here is simply to introduce you to this essential tool and make those future steps less mysterious. Think of it as learning where the basic tools are in a workshop before starting a project.
© 2025 ApX Machine Learning