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.”
Wake 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.
Author
'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
Learn more on Codecademy
- Skill path
Code Foundations
Start your programming journey with an introduction to the world of code and basic concepts.Includes 5 CoursesWith CertificateBeginner Friendly4 hours - Career path
Full-Stack Engineer
A full-stack engineer can get a project done from start to finish, back-end to front-end.Includes 51 CoursesWith Professional CertificationBeginner Friendly150 hours