UNIX Commands

basic convention used in many UNIX commands:
Ctrl-C            // quit program


man : getting help (manual)
% man man 
% man traceroute
% traceroute -h


Space key         // continue scrolling when viewing "man" or using "less"
b                 // go backward when viewing "man" or using "less"
q                 // go backward when viewing "man" or using "less"

ls : list files

% ls
% ls -l
% ls -a

cd : change directory (folder)

% cd
% cd ..               // move up one directory (.. means up)
% cd ~                // move to home ~ means home
% cd ~/Documents/     // move to Documents folder under home
% cd ~/Documents/Processing    
% cd ~/Documents/Processing/   // the final "/" makes it explicit that it is a directory    
% cd ../../../        // move three directory up
% cd .                // . means "here" 
pwd : display present working directory


cp : copy file

% cp file1 file2      // copy file1 to file 2
% cp ~/Desktop/test.txt foo.txt
% cp ~/Desktop/test.txt ~/Documents/

mv : move file

% mv file1 file2           // move file1 to file 2
% mv file1 html/lecture/   // move file1 to directory lecture

Other UNIX commands you might want to take a look at
netstat, less, cat, ssh, telnet, sftp, find, gzip, rm, mkdir, rmdir, wc, diff, grep, w, finger, whoami, ps, kill, last...

Some links from the Internet:
Unix Command Summary
Basic UNIX commands
Introduction to Unix commands
Notes

Required elements

<!DOCTYPE html>
<html>

<head>
<title>  </title>
</head>

<body>

</body>
</html>

Notes

Links









Anchor (link): <a> </a>


In order to create a link to another html file, surround the text that acts as a link with an anchor tag. The opening tag <a> includes an attributes of the tag. In order to specify the link destination, use the href (hypertext reference) attribute.









A link to a file in the same directory/folder as the current html file:

Sample file [before] [after]
     <a href="./second.html"> Go to another page </a>
   

Notes

Pathnames

Pathnames indicate where the file is located in the filesystem. There are two ways to specify a file.



Relative Pathnames

Navigating the file system hierarchy relative to the current file.

     ". " means the current folder 
     ".." means the folder directly above the current
    "/" represents a delimiting character 

href="./second.html"     <!--  located in the current directory -->

href="../above.html"     <!--  located in the directory one above (parent) -->

href="../../beyond.html" <!-- located two directories above (parent of parent) -->

href="./collection/file.html" <!-- located inside the directory "collection"
                                 in the current directory -->
     


Absolute Pathnames

Specifying the file based on their absolute location on the file system starting from the top. "Top" can be different depending on your system and how you are accessing your file. (The following shows the absolute pathname on a local computer. This will change once you move your file to the server).


	href="/Users/miyos/html/F17/ILCP/Lec/03_html_links.html" 


	<!--  Users -> miyos -> html -> F17 -> ILCP -> Lec -> 03_html_links.html -->


	href="http://people.reed.edu/~miyos/F17/ILCP/ilcp_schedule_s16.html" 

     

Avoid using spaces in pathnames/filenames. There are ways to get around the problem but it is tedious. Use "-" or "_" instead.

Assume case sensitive pathnames. Generally, all lower-case is recommended.




Why using relative pathname is useful:



As long as you keep the folder "myproject" intact, you don't need to worry about where it is in the web server.
  <a href="./c.html"> file C </a> // a link to c.html
With absolute pathnames, you have to explictly specify the hiearchy from the top and it is easier to break the links
  <a href="http://people.reed.edu/myproject/c.html"> file C </a> // a link to c.html
Notes

Linking to Files on a Web Server

Notice that in the previous example, we did not specify the name of the server. That means that the file that is linked to is assumed to be on the same (local) machine as the current file.

In order to link to a file on another server, you add the server information in front of the pathname.

A link to a file named "index.html" in a directory "/art/courses/" on the server "www.reed.edu" accessed through the "http" protocol:


    <a href="http://www.reed.edu/art/courses/index.html"> Courses </a>
  
Notice that in the previous example, we did not specify the name of the server. That means that the file that is linked to is assumed to be on the same (local) machine as the current file.

index.html

If a filename is not specified, "index.html" is assumed. Hence, the following will produce the same result.

    <a href="http://www.reed.edu/art/courses/index.html"> Courses </a>
  
    <a href="http://www.reed.edu/art/courses/"> Courses </a>
  

The following links to the file named index.html at the top directory on the server www.reed.edu:

    <a href="http://www.reed.edu/"> Reed College </a>
  
Notes

URL: Universal Resource Locater

You use URLs when specifying the link and also when you browse. An URL specifies the how and the where with the following syntax:

 protocol://hostname/pathname

http://www.reed.edu/index.html

http://www.nytimes.com/pages/arts/index.html

http://www.nytimes.com/2012/06/08/arts/design/caravaggio-denial-of-st-peter-met-museum-of-art.html

http://mycomputer.reed.edu/portfolio.html    // you can run a server on your own computer



https://www.amazon.com/gp/yourstore/          // uses https protocol

ftp://ftp.freebsd.org/pub/FreeBSD/            // uses ftp protocol

file:///Users/miyos/Desktop/file.txt 
// Note that there are three slashes (hostname is empty)

mailto://miyos@reed.edu
Notes

Naming files and pathnames

Notes

Linking to a Specific Location in a page

Sample file [before] [after]










Linking to a specific location in a page:








Destination area:

Create an Anchor (bookmark) using the id attribute. An anchor functions as the target destination for the link. Place the anchor tag with the id attribute in the place you want to jump to. Give the id a name. (In this case, "anchorname").
<a id="anchorname"></a>



Link source:

To create a link from the same document, use the id name with a hashtag (#) in the href attribute

<a href="#anchorname">jump to anchor</a>


To create a link to an anchor in another document,

<a href="file.html#anchorname">jump to to anchor in another html file</a>
Notes