Class 2. Setting up your class website
- Make sure you have a text editor such as Atom, Sublime Text, or Brackets. If not, download one.
- If you don’t already have one, create an account on http://github.com. If it’s a new account, make sure to verify it by clicking on the link in your email.
- Make sure you have downloaded web browser.
Introduction to UNIX
UNIX is a plain-text operating system. It’s the backbone of some modern-day operating systems such as Linux and Mac OSX. Using UNIX depends on a series of prompts or commands, this is called the Command-line Interface (CLI). We’ll be interacting with the Command-line and UNIX with the application Terminal.
- Open the application Terminal and a new Finder window
- In Terminal, a few things should be in view:
- Last login date
- Your username
- Name of your computer
- Size of the Terminal window (probably 80 x 24)
- Prompt for entering commands
- Type the command pwd into the terminal and hit enter.
- This is short for “Print Working Directory.” It’s sort of like a “You are here” for your computer.
- After entering the command, you should see something like: /Users/yourusername directly above a new prompt.
- Files and Folders
- Type the command ls into the terminal
- This is short for “List” and will list all the files in your working directory
- Try typing ls -F , this will reveal the nature of a file for example / for a directory.
- Navigating the File Tree
- Now that we can see where we are, we can decide where we want to go.
- Type the command mkdir Sites and hit enter.
- mkdir is short for “Make Directory” and will make a new folder with the name “Sites”
- If you re-type the “List” command, you should notice a new option called “Sites”
- Type the command cd Sites into the prompt.
- This is short for “Change Directory”
- If you enter the command to print your working directory. You should now be in a folder called Sites.
- Add a new directory to your Sites folder called ‘interactive’ and use Terminal to enter into it
- Creating and opening Files
- Double-check you’re in the folder /Users/yourusername/Sites/interactive
- Enter the command touch index.html
- ‘Touch’ creates new files for any file names that are provided as arguments (i.e., input data). Touch can create any number of files simultaneously.
- Enter the command open index.html -a Atom
- Depending on which text editor you’ve downloaded, you’ve either opened it in a new application or returned an error. If you’ve gotten an error try retyping the command, but using your text editor instead instead of Atom
- cd argument
- cd ../
- mkdir Sites