1 of 2

Name:

PID: (page 1)

curl <downloadlink> -o <outputfile>

curl connects to the Internet and downloads the content from the link. “-o” allows us to save it

ssh <username>@<servername>

ssh switches your terminal's context to running commands on another computer. It stands for "secure socket shell". A shell is the program running in your terminal, or on another computer, to run commands. Depending on how the other computer, and your account, is set up, commands may work a little differently in the remote shell compared to on your computer. The commands will be working with the filesystem from that computer.

What are some reasons you might want to run commands on a computer that isn't the one you're physically logged into? Why do we get the file not found error? Discuss with the people around you, and write down some thoughts.

[user@sahara ~]$ ssh cs15lfa23zz@ieng6.ucsd.edu

... warning messages ...

(cs15lfa23zz@ieng6.ucsd.edu) Password: <input your password>

[cs15lfa23zz@ieng6-201]:~:19$ curl https://raw.githubusercontent.com/ucsd-cse15l-w23/WhereAmI/main/WhereAmI.java -o WhereAmI.java

[cs15lfa23zz@ieng6-201]:~:21$ cat WhereAmI.java

class WhereAmI {

public static void main(String[] args) {

System.out.println(System.getProperty("os.name"));

System.out.println(System.getProperty("user.name"));

System.out.println(System.getProperty("user.home"));

System.out.println(System.getProperty("user.dir"));

}

}

[cs15lfa23zz@ieng6-201]:~:22$ javac WhereAmI.java

[cs15lfa23zz@ieng6-201]:~:23$ java WhereAmI

Linux

cs15lfa23zz

/home/linux/ieng6/cs15lfa23/cs15lfa23zz

/home/linux/ieng6/cs15lfa23/cs15lfa23zz

[cs15lfa23zz@ieng6-201]:~:24$ exit

logout

Connection to ieng6.ucsd.edu closed.

[user@sahara ~]$ javac WhereAmI.java

error: file not found: WhereAmI.java

### Let’s run the same curl command from above, here!

[user@sahara ~]$ javac WhereAmI.java

[user@sahara ~]$ java WhereAmI

Linux

user

/home

/home

You all have accounts specific to CSE15L on a server called ieng6.ucsd.edu that is managed by UCSD. A server is another word for a computer or a program running on a computer that enables communication to other programs and computers – ssh is one of the programs that does this communication.

Path: Where a single file or folder is within a filesystem

Root: The folder that isn't contained in any other folder. Often written as / or C:\\

Absolute path: A path that includes root. Example: /home/lecture1/README

Relative path: A path that doesn't include the root, interpreted relative to a current directory. Example: lecture1/README

Parent directory: The directory “above” or “outside” the current directory. Written ..

Current/working directory: A directory a program or terminal is using for relative paths.

Starting from the working directory /home/lecture1/messages/, what absolute path or file do each of these refer to?

/home/lecture1/Hello.java

../Hello.java

../lecture1/Hello.java

/home/lecture1/messages/../Hello.java

./Hello.java

home/lecture1/Hello.java

~/lecture1/messages/Hello.java

~/lecture1/Hello.java

2 of 2

Name:

PID: (page 2)

https://www.google.com/search?q=cse15l

HTTP(S) URL: Where a single web resource is located, potentially including extra "arguments" (the query after ?)

Domain: The part of the url after the https:// and before the first slash, usually ending with .com, .edu, .net, .org, .gov, and so on, or country codes, like .uk, .jp, etc. This usually corresponds to some organization or person, like www.google.com above

Path (part): The part of the URL after the domain and before any ?. /search in the example above

Query: The part of the URL after the first ? and before the anchor. ?q=cse15l in the example above.

Anchor (or Fragment): The part of the URL after the #. Not in the example above; usually page-specific data (like where to scroll)

URLs are a lot like paths! Github Pages gives you your own domain (it's a subdomain of github.io) at <username>.github.io

What are the domains, paths, queries, and fragments of these URLs?

https://edstem.org/us/courses/41619/discussion/3541501

https://ucsd-cse15l-f23.github.io/week/week1/#week1-lab-report

https://map.concept3d.com/?id=1005#!m/576556

When you write a link in Markdown, just like in the filesystem, it can be relative or an absolute URL (kind of like an absolute path). Say you have a Github Pages site with the following structure (and say the username for the account is cs15l-student):

cs15l-lab-reports

|- index.md

|- lab-report-1.md

|- profile-pic.jpg

|- more-images/

|- screenshot.png

What are two ways to write an image link in lab-report-1.md that refer to profile-pic.jpg? What about to screenshot.png? What are some tradeoffs between them?

What are two ways to write a link from index.md that refers to the lab report page?

A developer is working on a Github Pages site. They are adding an image to their readme.md file. The image looks great

in their Code preview, but on their Github Pages site it appears as a broken image link. Here's their code preview

and their Github repository:

What's going on? What mistake or mistakes might they have made?