
A folder is just a folder! However, when you're a programmer, it's important to keep your code structured and organized.
#Linein download mac code
Hint: remember that for the Art History folder, you'll need a backlash after the word "Art" because it's two words, or you'll need to put it in quotation marks! Code exampleĬreating folders is exactly the same process whether or not there will be code inside of them. Now it's your turn! Create folders for the school subjects listed above:
Whether you use quotation marks or a backslash in order to create folders with multiple words, you'll be all set. Or escape (meaning ignore the special meaning of) the space by prefacing it with a backslash, a confusing but common programming habit: Multiword folder name with an escaped character (via a backslash) You can use quotation marks: 👍 Multiword folder name with quotation marks Use hyphens instead of spaces to create a different folder name entirely (i.e., mkdir Second-semester ) In programming, you'll often use backslashes to escape special characters! We want a space to just be a literal space, not for Terminal to interpret it as a way to separate multiple folder names. This says that the special meaning of the space between "Second" and "semester" should be ignored. This says the folder name should include all characters inside the quotation marks.Įscape the special character (the character you're computer is interpreting in a special way) using a backslash, i.e, mkdir Second\ semester Use quotation marks, i.e., mkdir "Second semester" To create or reference a folder with multiple words in it, you have three options: "Semester") are created instead of one: mkdir mistakes: two folders instead of oneīy running mkdir Second semester, I've accidentally created 2 files: one called "Second" and one called "semester." This is because my computer interprets the space between the two words as a delineation between two folders names, not just a space in the middle of one name.Ĭlearly, we need a different way to indicate "Second semester" is all one file name not two separate ones. Notice that, by running mkdir Second semester, two folders (1. Nope! 😖 You need to make special considerations for folder names that contain spaces. In theory, I'd run mkdir Second semester to create a folder inside called "Second semester," right? In our example, the folder should be called "Second semester." We've just created a folder called "School" in order to stay organized. You need to run cd plus the folder name to do that! Folder names with multiple words Simply making a folder using mkdir doesn't move you into that folder. Your Terminal window will look like this: Make a "School" directory (mkdir School) and move into it (cd School) Make a directory (folder) called School: mkdir SchoolĬhange directories into the School directory: cd School Substitute another folder name from the list outputted by the ls command). List the contents of your current directory: lsĬhange directories into the Desktop directory (if you don't have a Desktop folder, it's fine. Print the working directory (see where you are): pwd You can run the following commands, hitting the Enterkey after each. The "Desktop" or "Documents" folder could be a good place to be.


Why is this important? Once you get into any kind of programming (design, front-end, back-end, and more), you'll almost always create folders and files for your code via the command line. You'll have a huge advantage as a beginner if you're comfortable with this.įrom your command line, make sure you are in a place in your system that you can remember. You'll create this same equivalent for second semester ing Terminal, of course. The first semester folder that you'll use as inspiration is organized like this: First semester folder structure You need to create the same folder for your second semester coursework. On your computer, you have a complete folder called "First semester" that holds all your first semester coursework. Scenario: You're at university, and you've just started your second semester. If I wanted to create a folder called new-folder , I would run: mkdir new-folder

mkdir is short for "make directory." Specify the name of the directory (folder) you want to create just after it. Use the command mkdir to create a directory. How does one go about creating a folder in Terminal? Time for a new command! mkdir If you want to get more into programming! However, there are advantages to doing this via the terminal, especially Yes, you could just do this via Finder or whatever tool you use to browse and create files now. It's now time to create a folder within your system.
