Skip to content the Coding Environment | CurioCity

the Coding Environment

The Coding Environment

Terminal (or Command Line)

Every computer (Mac, Windows, or Linux) has a Terminal (Command Line in Windows). To open it, find the application on your computer, and double click to open it.

You can think of the terminal (or command line) as a way to talk directly to your computer by typing simple instructions. Instead of clicking or dragging icons or buttons (like you would if you wanted to move folders across your computer), you use short text commands to quickly navigate through your files, start programs, or automate tasks.

the Terminal

We will be using the terminal a LOT in our course. Make sure to do the practice problems if you have never used the Terminal before.

The Terminal on a Mac: terminal The Command Line on a Windows: command-prompt

The following are some basic commands that are useful to know in the Termina/Command-Line:

ActionmacOS / Linux (Terminal)Windows (Command Prompt)
Show current locationpwdcd
List files & folderslsdir
Change directorycd foldernamecd foldername
Go up one directorycd ..cd ..
Create foldermkdir foldernamemkdir foldername
Create empty filetouch filename.txttype nul > filename.txt
Copy filecp file1.txt file2.txtcopy file1.txt file2.txt
Move or rename filemv old.txt new.txtmove old.txt new.txt
Delete filerm filename.txtdel filename.txt
Delete empty folderrmdir foldernamermdir foldername
Clear terminal screenclearcls

Practice Problems (Highly recommend if you’ve never used Terminal!)

  1. Create a new folder in your home directory.

Click to see answer In MacOS:

Terminal window
cd ~
mkdir my_new_folder

In Windows:

Terminal window
cd %HOMEPATH%
mkdir my_new_folder
  1. List all the folders in your home directory. Your new folder should be one of the folders listed.

Click to see answer In MacOS:

Terminal window
ls

In Windows:

Terminal window
dir
  1. Navigate into your new folder.

Click to see answer In MacOS and Windows:

Terminal window
cd my_new_folder
  1. Make a new txt file inside this new folder that says β€œYOUR SECRET KEY: 12lka09werk;as93kfls!” inside of it (only using Terminal/Command Line prompts).

Click to see answer In MacOS:

Terminal window
echo "YOUR SECRET KEY: 12lka09werk;as93kfls!" > secret_key.txt

In Windows:

Terminal window
echo YOUR SECRET KEY: 12lka09werk;as93kfls! > secret_key.txt
  1. Navigate to the Desktop of your computer.

Click to see answer In MacOS:

Terminal window
cd ~/Desktop

In Windows:

Terminal window
cd %HOMEPATH%\Desktop
  1. Look for the file location of the secret key file (Hint: use a command like grep).

Click to see answer In MacOS:

Terminal window
grep -rl "YOUR SECRET KEY" ~/

In Windows:

Terminal window
findstr /s /m "YOUR SECRET KEY" %HOMEPATH%\*.txt
  1. Move the secret key file to your desktop.

Click to see answer In MacOS:

Terminal window
mv ~/my_new_folder/secret_key.txt ~/Desktop/

In Windows:

Terminal window
move %HOMEPATH%\my_new_folder\secret_key.txt %HOMEPATH%\Desktop\

Even after completing these exercises, we recommend you play around with these commands and get familiar with how the Terminal/Command-Line works.

Integrated Development Environment (IDE)

What are Integrated Development Environments? Think of an IDE as your coding studio! It is the application that you will be using to do all things related to developing your application.

The IDE is packed with features like a code editor, debugger, and even autocomplete, which gives you coding suggestions. It also allows you to navigate through your code files easily!

IDE

Different Components of an IDE:

  • File Access: Choose which files to access and edit in your project
  • Text Editor: Write and edit code
  • Terminal (or Command prompt): Run commands
  • AI Assistant Where you can prompt AI to generate code and give you tips

what-is-ide.png

Cursor is an AI tool that functions as an IDE. The image above actually shows the Cursor IDE. You will be using it to write, debug, test, and deploy your code. You will want to download it and make sure you are comfortable with using it!

Some cool tricks:

  • Command + click (or control + click on Windows) certain lines of code and it’ll show you where..
  • Command + p (or control + p on Windows) allows you to search for any file in your project
  • Command + shift + p (or control + shift + p on Windows) allows you to search for any command in your IDE
  • Command + click some line of code, and it will bring you to the source code (where it is defined) in a multi-file project.

If you want a non-AI IDE, we highly recommend downloading VSCode. Otherwise, use the steps in the Getting Started section to download Cursor!