The file and its address

Quick check: can you make the page, write its path, and read one ls -la line?

Pass at 70%. Feedback appears as you go, and only your first answer to each question counts.

Question 1 of 6

A classmate's ls -la line is -rw-r--r-- 1 sam sam 12 Jul 29 04:25 index.html. What do the leading - and the 12 tell you?

Show answer

Answer:

The leading - means this is a regular file, not a directory. The 12 is the size in bytes.

A full-credit answer shows: A strong answer covers: (1) - is the type character for a regular file (d would be a directory); (2) 12 is the size in bytes.

Type character first, size after owner and group. The name at the end is index.html. Permissions exist but you only needed those two fields here (objective 8).

Question 2 of 6

You are standing in ~/projects. What does ../projects/first-site refer to, and what does ./first-site refer to?

Show answer

Answer:

./first-site is the first-site folder inside the current directory, ~/projects. ../projects/first-site goes up to home, then back into projects/first-site — the same folder, the long way round.

A full-credit answer shows: A strong answer covers: (1) . means here, so ./first-site is ~/projects/first-site; (2) .. means the folder above, so the longer path is also ~/projects/first-site.

Both paths name the same folder if you started in ~/projects. . is here; .. is up one. The first character is not /, so both are relative (objectives 4, 5).

Question 3 of 6

Index.html and index.html are the same file on a default Mac.

Show answer

Answer: True

Default APFS is case-insensitive (and case-preserving), so those two names land on one file. On Linux they are two files. A site that works on a Mac can 404 on a Linux server over one capital letter (objective 6).

Question 4 of 6

You just made ~/projects/first-site/index.html and double-clicked it. The address bar reads file:///home/sam/projects/first-site/index.html. What is that URL naming?

Show answer

Answer: This file on this machine, as a path the browser can follow

A file:// URL is the same path you already have, written so a browser can open it. It is not a public address, it is not a server, and the Desktop is the wrong home for this project (objectives 1, 2).

Question 5 of 6

On Linux, home is /home/sam. Which of these is an absolute path to the project page?

Show answer

Answer: /home/sam/projects/first-site/index.html

An absolute path starts with /. ~ and ./ are useful abbreviations, and projects/… is relative — none of those start from the top of the machine (objective 4).

Question 6 of 6

You rename notes.txt to notes.html. The icon changes. What happened to the bytes on disk?

Show answer

Answer: They stayed the same — only the name changed

The tempting wrong idea is that the extension converts the file. It does not. The name is a hint about which program to launch. The bytes are whatever you typed (objective 7).

Erase saved progress?

This erases all quiz scores, reading progress, project checklists, and your name on the certificate. It cannot be undone, and it affects only this course in this browser.