Command Line Interface
Background:
The command line interface is a program on your computer that allows you to create and delete files, run programs, and navigate through folders and files. On a Mac, it’s called Terminal, and on Windows, it’s Command Prompt.
Most developers navigate their computers and run the programs they build directly from the Command Line. Using a few typed words, you can run a program you wrote, move through your computer’s file system, and even edit existing files. The Command Line is a powerful application and will unlock new avenues in your programming ability.
This article will walk you through how to find and begin using the Command Line on your own machine. We won’t cover how to use and manipulate the command line interface in much detail. If you’re not familiar with the command line, take our Learn the Command Line course.
Pro Tip: Command line interface is commonly abbreviated to “CLI.”
Intro to the Command Line
Discover the power of this simple yet essential text-based tool and increase your productivity as a developer.Try it for freeWake Up Terminal! (Mac)
- Find the Terminal application with Finder and navigate to the directory of your choice. If you took Codecademy’s Learn the Command Line course, you’ll already know how to do this. Otherwise, see the instructions below.
Instructions
- When you first open Terminal, you are in the root directory. Navigate to your Documents directory with
cd Documents
. - Create a new folder called “my_project” with
mkdir my_final_project
. - Change your directory to the folder you just created with
cd my_project
. - Create a test file with
touch test.rb
(This will create a ruby file within the my_project folder).
Wake Up Command Prompt! (Windows)
- Search for the Command Prompt program and navigate to the directory of your choice. If you took Codecademy’s Learn the Command Line course, you’ll already know how to do this. Otherwise, see the instructions below.
Instructions
- When you first open Terminal, you are in the root directory. Navigate to your Documents directory with
cd Documents.
- Create a new folder called “my_project” with
mkdir my_project
. - Change your directory to the folder you just created with
cd my_project
- Open Sublime Text, click on File > New File , then navigate to Documents > my_project, and save the file as
test.rb
. (This will create a ruby file within the my_project folder.)
Wrap-Up
Now that you’ve awakened your Command Line, it’s time to start using it. Since the Command Line is text-based, it can seem intimidating. Don’t worry though, it is pretty simple and the rewards for learning its commands will come back to you over and over.
You can start learning the command line in our Learn the Command Line course. There, you’ll learn how to move through your computer’s file system, how to create files from the command line, and much more. As you learn more programming languages within Codecademy, check out the articles associated with them. We’ll teach you more language-specific commands, which will prepare you to build your very own programs.
'The Codecademy Team, composed of experienced educators and tech experts, is dedicated to making tech skills accessible to all. We empower learners worldwide with expert-reviewed content that develops and enhances the technical skills needed to advance and succeed in their careers.'
Meet the full teamRelated articles
- Article
Complete List: Command Line Prompt (CMD)
Learn key command line and CMD commands for file handling, navigation, and environment setup. Master redirection, search, aliases, and more. - Article
Setting Up Go Locally
Read this article to set up the Go programming language on your computer and start making your own programs locally! - Article
List of Command Line Commands
Glossary of commonly used commands
Learn more on Codecademy
- Free course
Intro to the Command Line
Discover the power of this simple yet essential text-based tool and increase your productivity as a developer.Beginner Friendly1 hour - Course
Learn the Command Line
Learn about the command line, starting with navigating and manipulating the file system, and ending with redirection and configuring the environment.With CertificateBeginner Friendly4 hours - Free course
Learn the Command Line: Viewing and Changing the File System
Learn how to manage filesystems and manipulate directories from the command line.Beginner Friendly1 hour