Lecture 2: Tools & Concepts CMPSCI120 Editors WIN NotePad++ Mac Textwrangler 1
Secure Login Go WIN SecureCRT, PUTTY WinSCP Mac Terminal SFTP WIN WinSCP Mac Fugu 2
Intro to unix pipes & filters file system Intro to unix commands see http://mally.stanford.edu/~sr/computing/basic-unix.html use wildcards with caution some commands will not work depending on the system ls lists your files ls -l lists your files in 'long format', which contains lots of useful information, e.g. the exact size of the file, who owns the file and who has the right to look at it, and when it was last modified. ls -a lists all files, including the ones whose filenames begin in a dot, which you do not always want to see. mkdir dirname make a new directory cd dirname change directory. You basically 'go' to another directory, and you will see the files in that directory when you do 'ls'. You always start out in your 'home directory', and you can get back there by typing 'cd' without arguments. 'cd..' will get you one level up from your current position. You don't have to walk along step by step - you can make big leaps or avoid walking around by specifying pathnames. pwd tells you where you currently are. 3
Reading,creating & deleting files cat filename prints the file to your terminal window more filename shows the first part of a file, just as much as will fit on one screen. Just hit the space bar to see more or q to quit. You can use /pattern to search for a pattern. mv filename1 filename2 moves a file (i.e. gives it a different name, or moves it into a different directory (see below) cp filename1 filename2 copies a file rm filename removes a file. It is wise to use the option rm -i, which will ask you for confirmation before actually deleting anything. You can make this your default by making an alias in your.cshrc file. diff filename1 filename2 compares files, and shows where they differ wc filename tells you how many lines, words, and characters there are in a file chmod options filename More - history, processes, logout ps lists running processes history lists your most recent commands who tells you who's logged on, and where they're coming from. logging off exit logout 4
A short demo Basic html <tag> </tag> Document Root <html> <head> <body> <title> Attribute href <a> <h1> Text: My title Text: My title Text: My header 5
Basic html <html> <head> <title> CMPSCI 120 Home Page</title> </head> <body> <h1>cmpsci 120: Introduction to Problem Solving with the Internet</h1> <p>the Internet is a goldmine to the Internet such as copyright laws, First Amendment issues, and public key cryptography. </p> <h2>prerequisites:</h2> </body> </html> DOCTYPE declarations HTML 4.01 Strict -- This DTD contains all HTML elements and attributes, but does not include presentational or deprecated elements (like font). Framesets are not allowed. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/tr/html4/strict.dtd"> HTML 4.01 Transitional -- This DTD contains all HTML elements and attributes, including presentational and deprecated elements (like font). Framesets are not allowed. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/tr/html4/loose.dtd"> HTML 4.01 Frameset -- This DTD is equal to HTML 4.01 Transitional, but allows the use of frameset content. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/tr/html4/frameset.dtd"> XHTML 1.0 Strict -- This DTD contains all HTML elements and attributes, but does not include presentational or deprecated elements (like font). Framesets are not allowed. The markup must also be written as well-formed XML. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> XHTML 1.0 Transitional -- This DTD contains all HTML elements and attributes, including presentational and deprecated elements (like font). Framesets are not allowed. The markup must also be written as well-formed XML. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> 6
A short demo 7