Quick Index
What Is A Console?


The console is the command interpreter of the system. It is a low level tool that let's us compile and run programs at the lowest level as well as do other tasks.

Note: In Windows the console is called the "command prompt" and on the MAC the console is called the "Terminal".

It's valuable to have in our toolbox.

Opening Console in Windows


Easiest Approach
  • Open the File Browser/Explorer
  • Navigate to your desired target directory
  • In the address line at the top of the window, type in "cmd"
  • Hit Enter


Here are some more options:


Opening Console on The MAC


See these options:


Current Directory And Changing Directories


"Current Directory" is an important concept when working in a console window. Let's look at an example.

When we first open the console we'll see an initial current directory. In our example, it is "Courses".

The full path to the current directory is "C:\Work\Courses".
C:\Work\Courses>
  • If the current directory (e.g. "Courses" in our example) has a sub-directory named "Scratch", then we can change directory to it using the "cd" command as shown.
  • We see that the new current directory has changed to "Scratch.
C:\Work\Courses>
1
cd Scratch C:\Work\Courses\
2
Scratch>

Console Commands


For learning programming there are just a few key commands to know in the console.

Windows (Command Prompt)

CommandDescription
dirLists the files in the current directory
cd Foochange directory to the child sub-directory "Foo" (replace "Foo" with a real subdir name). See this...
cd ..change directory to parent directory (move up one directory)


MAC/Unix (Terminal)

CommandDescription
lsLists the files in the current directory
cd Foochange directory to the child sub-directory "Foo" (replace "Foo" with a real subdir name). See this...
cd ..change directory to parent directory (move up one directory)