summary
This is an intro to a small subset of UNIX commands and computing info that will make your use of Dante easier (since Dante is a UNIX system). I am not responsible for the use of any of the information here. This is not a conceptual approach to UNIX either, so there is a lot missing. Be especially careful with commands that I say can mess your stuff up.
contents
the tc shell for entering commands
the UNIX directory tree
file permissions
listing files in directories, and moving around
move, copy, remove files
text editing and email
good data storage
what the Internet is
connecting between computer systems using telnet/ssh
moving files from one place to another (ftp/scp)
other UNIX references online
file restore
web publishing
the tc shell shell for entering commands
When you login to Dante (or Homer) you see that menu called the P shell:
--- Welcome to Dante ---
Your computer for easy access to electronic mail and information.
Dante - electronic mail and information access
Press one of the following keys:
E - email: Electronic mail (Pine version 4.21)
U - uwhome: UW Homepage, via Lynx
H - host: About Dante, the Student Technology Fee, guidelines
A - announce: Announcements from UW Computing & Communications
O - other: Other choices
S - shell: To enter Unix commands
L - logout: End session
For use by authorized UW account holders only.
NOT FOR COMMERCIAL USE.
To start using UNIX commands type S for Shell, then type tcsh at the command line like so:
dante12% tcsh
Instead of typing dante12% etc over and over I'm just going to show the commands. So if I say type tcsh, or use the command tcsh, it means type "tcsh" just like I've typed it above. If I say type 'ls -laF' it means type whatever is between the quotes, but don't include the quotes like so:
dante12% ls -laF
It's pretty straighforward. The default is c shell, which is not very user friendly so this tcsh command will make life a lot easier by using a different shell.
When you need to exit the shell (the command line) just type 'exit'.
the UNIX directory tree
So UNIX has been setup with one folder, and contained within that folder is a system of folders within folders. When you visually lay out all of the folders, mapping them out so that you can see them, the illustration looks like a tree so they call the UNIX file system--in general terms--the directory tree. That one folder that starts it all is called the root folder and it is represented by a single forward slash: / Say you have a folder within root called user, and within user you have one called local, and within that you have one called bin, and within bin you have a file called hello.txt, the path to the file 'hello.txt' is /user/local/bin/hello.txt In other words, you follow from the trunk of the tree--in our illustration--up the branch of the tree called user, off that branch shoots another one called local, and off that is one called bin, which finally terminates at hello.txt.
There are relative ways of referring to your current directory, and ways of finding out exactly where you are (in absolute terms) from a relative perspective. The present working directory command 'pwd' will tell you exactly where you're located. Just like the symbolic link on the previous page showed a weird pointer: public_html@ -> /dw03/d03/jimmi/ that is saying that the relative label of public_html really points in absolute terms to a place on the directory tree which is: /dw03/d03/jimmi/. If you're in a directory and need to refer to it, in relative terms, just type './' and to do the same for the directory above you type '../' so if I want to move in relative terms from a subdirectory in my home directory, to the public_html directory I just type: cd ../public_html meaning up one level, and down into public_html.
UNIX file permissions
UNIX is really cool because it was designed with security and networking (lots of users) in mind. There is this thing called permissions, that does exactly what it implies: restrict access. Basically every user and file on a UNIX system has permissions or access that are preset. The Root user has all permissions, and can see or do anything, but mere mortals like us can/may only manage our personal files and directories. There are three parts to permissions (there are really 4 but you rarely hear about sticky bit even when you use UNIX a lot). These are read write and execute permissions: rwx respectively. I always remember them as being represented alphabetically, rwx, and each letter corresponds with a number that is in reverse order: r = 4, w = 2, x =1. You can see this when you list the files with the extra stuff as in 'ls -l' you saw:
lrwxrwxrwx 1 jimmi user
Notice that these letters are each repeated 3 times. This is because the UNIX system has three groups: the owner, which is represented first, the group, which here is 'user', and the rest of the world. Note that for this item, everyone has read write and execute permissions because each grouping has rwx. So to clarify, each file has an owner, and a group it's associated with, and the owner (or root) sets the permissions for the file allowing individuals to read the file, edit (or write to) the file, or execute the file. Permissions are changed with the command chmod and there is a lot written on how to do that, so I won't talk about it here. Look at the man page (man chmod) or click here for more info. Note that for directories (they're a special case), they must be executable in order for you to be able to look in them.
listing files in directories, and moving around in UNIX
To look at what you have on Dante you need to list files, just use the ls command to list them. There are a few flags (optional arguments) you can use to show extra details.
'ls -F' will show all the directories with a trailing / sign
'ls -la' will show (respectively) all the file info, and all the dot files which are normally hidden (eg .addressbook which is your Pine addressbook)
here's some sample output and the command:
dante12 jimmi ~ % ls -laF lrwxrwxrwx 1 jimmi user 15 Sep 26 1999 public_html@ -> /dw03/d03/jimmi/ -rw-r----- 1 jimmi user 2057 May 07 2000 resume.txt drwxr-x--- 5 jimmi user 512 Oct 19 14:51 typography/
Left to right it first shows my public_html directory which is really not a directory but a symbolic link to another directory (indicated by the leading "l" in lrwx....) then it says what the file permissions are (a whole topic I don't discuss here) then who the owner is, it's me, next is the group I'm part of which is user, then how big the file is in bytes, so it's 15bytes--really really small. Next is the date it was last modified, the filename, and for the symbolic link it is showing where it points to which is the directory at the path: /dw03/d03/jimmi/ Next is the resume.txt text file, and then the directory (drwxr.....) typography indicated by a trailing back-slash typography/
To move/change to a different directory just use the cd command for change directory:
cd typography
moves me to my typography/ directory. To get back to the home directory just
dante12% cd ~
To make a new directory just use the make directory command: 'mkdir dirname'
where you replace dirname with whatever name you want to use. Don't use spaces or special characters except _ and - in the directory or your file names if you can help it. If you ever have a space in the name, you can "escape" it by putting the \ character before the space (or other special character), or you can double quote "the whole thing":
cp "this file here.txt" that\ file\ there.txt
move, copy, remove files
With the following commands you have to be really careful because you can mess up your files really easy, especially if you don't know what you're doing (ie the first few times you use them).
mv renames or moves files. It overwrites files too so use it with care. You have to have a source file and destination file designated like so:
mv filename1 filename2
that will rename filename1 as filename2. If filename2 already exists before you do that then it will be overwritten (destroyed) after you use this command.
cp will copy files from place to place. The syntax is sortof weird so always spell out the destination clearly:
cp filename destination/filename
This copies filename to the folder "destination" so it will now be in the current directory and in the "destination" directory.
rm will remove files, 'rm -r' will remove directories. So use it with 'rm filename' or 'rm -r directoryname'.
text editing and email
Pico is a simple text editor you can invoke using the command pico. Type 'pico filename' to open the text file 'filename' in Pico. Note that when you're working you have to write-out the file, which is the same thing as saving it. You basically write out from memory (RAM) to the hard drive so it's permanently stored. Pine is an email client available on UNIX that you start with the pine command. Pine uses Pico as the internal text editor, so when you've written email using Pine you're really using Pico at the same time. Both Pine and Pico use the same command syntax where ^ means the Control (Ctrl) key, and key combinations are used to send commands to the program: '^O' to write-out (meaning save) the file is simply the key combination control+O. Basic commands are shown at the bottom of your terminal in Pine and in Pico.
good data storage
You've gotta be careful about digital storage, because strange things happen. Solar flares, irritating classmates, bad drives, bad filesystems, bad code, and stupid mistakes can all corrupt your files without notice. I try to keep copies of my important files in at least two places, and once I've gotten to a certain milestone in a project I save the original as a backup and give the newer work a newer filename. This way if the file gets corrupted I've only lost so much time, and if all the files get corrupted on whatever media or filesystem I've stored them on, I can go to that other special place and get it. I'm saved basically. Dante is really good as the secondary storage place (especially since it has its own tape backup and recovery system) so I ftp those important backup files and it's super easy to recover.
You can check your current disk quota/use/space by using the 'assets -q' command (I think we all get 200MB now so contact Computing & Communications Information to find out more: help@cac.washington.edu).
If you damage a file on Dante and need it fixed call C&C Information (543.5970) for a file restore--within 7 days of the corruption as I recall.
what the Internet is
So imagine you've got 5 million computers, and you want to be able to have them to communicate back and forth. Maybe one person wants to move some research data, another person wants to move some audio files, someone else wants to send a personal note the their buddy in India. Well, for about 100 years people have been connected to a huge telephone network, so we decide that we will tap into that idea and just network all these computers. Problem is you they have to have them all talk the same language, but they want a bunch of different features. So they develop standards for how the computers will communicate. Naturally each different need gets a different standard language, so you start having these protocols emerge, things like http, ftp, smtp, telnet, ssh, and soon we're buried in a mountain of acronyms. We use now-familiar buzzwords like "the web", "the Internet" and "email" but what we're really talking about are groups of protocols that are used by a ton of networked computers to communicate in a meaningful way across a massive and diverse network. So the Internet is a bunch of computers all hooked together that use protocols, a small part of it is the web, and a big part of it is email.
Now think about all those computers. Thats a lot. There has got to be a way to say "I want this data to goto computer 489000 and not all or one of the other 4,999,999 computers. So we have this address system that uses numbers called the Internet Protocol, or IP addresses. Every computer gets an IP address. When you dial up, when you connect via DSL, or cable, or at the UW, every box has an IP address. When you send an email or look at a webpage along with that is something that says: this is my IP address. So when you hack the Pentagon, they look in their logs and see an address, then they use a few tools to look up who manages that group of addresses, then they call them and say "at this time we had an IP address of that" and they find in the logs who it was that was online at that time and with that IP. Then they come knocking on your door....
Since they have all these ip addresses floating around, they decided it would be easier to use names and letters instead of numbers, so they came up with a translating system called the Domain Name System, or DNS. So when you type in www.washington.edu it talks to the domain name server and asks what IP address that resolves to. I wanted to find out for you, so I went to the shell and typed in:
% domain www.washington.edu
www.washington.edu:
Internet address = 140.142.3.7
= 140.142.15.163
= 140.142.3.35
= 140.142.15.233
Mail exchanger = mx1.cac.washington.edu, preference 10
= mx2.cac.washington.edu, preference 10
CPU = ; OS = ; Randomizing cluster
TXT = "ndc-sysmgt@cac 5-4180"
It looks in its database, and you can see that there are four IP addresses that all do the same thing. When you type in www.washington.edu you get web pages delivered from one of these four actual computers.
connecting between computer systems using telnet/ssh
To connect to systems use ssh (secure shell) instead of telnet whenever possible. Non-secure ftp and telnet tools allow people to see EVERTHING (including your password) when you enter them. Just beware. In general:
ssh jimmi@dante.u jimmi@dante.u's password:
Telnet is available on most computers. In Windows just go Start>Run and type in "telnet hostname", if it has the right protocols installed in the operating system, and an active connection, then it will open a new window where you enter your login information.
moving files from one place to another (ftp/scp)
I imagine most of you will be using Fetch, WS FTP, or Internet Neighborhood to move stuff around. Each of these programs is simply an interface (buttons and graphical elements) on top of an FTP program. FTP is one of many Internet protocols and is an acronym for File Transfer Protocol. There are 2 very important things to remember about moving files with FTP tools. Don't forget these or you could ruin your files. First there are two modes for sending files, binary and text. Often the FTP tool will be able to figure things out using the Automatic option, but I've found that Fetch is sometimes setup wrong and will corrupt my files by defaulting to text mode when it shouldn't. (All the automatic feature does is guess whether the file should be sent in binary or text mode. Images and most of the files you will use are binary type, but email and text files are text type files.)
Secondly you need to remember that these tools will usually overwrite any file existing at the destination that has the same name as the file being sent by ftp. That means the file that gets overwritten is destroyed and replaced with the new file. This could be true on uploads to another system and not downloads, or it might not be, so I always rename files unless I really want them overwritten. Way better to be safe than sorry.
There is a secure alternative to FTP called secure copy (the scp command) that will prevent people from seeing your password etc. It's a hassle to use, but if you're concerned about security you'll need it--especially if you run Linux. This is just an abbreviation of the command, see the man page for scp for all the gory details. I make a tarball (archive file using the tar command) for big batches of files.
to upload stuff:
scp ./local/path/to/file user@host.com:path/to/file
to download:
scp user@host.com:path/to/file ./local/path/to/file
other UNIX references online
the manual pages: use man command (eg 'man ls') for more info right from the shell, use 'man -k keyword' to search for 'keyword'
http://www.geek-girl.com/Unixhelp/
http://www.geek-girl.com/unix.html
http://hotwired.lycos.com/webmonkey/reference/unix_guide/index.html
http://whatis.com/
http://whatis.com/Flat_Files/WhatIs_File_Format_A/
http://www.washington.edu/computing/unix/
email help:
help@cac.washington.edu (same as help@u)
let me know if you're looking for books and I can recommend some.
web publishing
what it is
All web publishing means is that you have a computer folder, or files somewhere that the public can access through a web browser. In UNIX the permissions and file ownership are another control for web-accessible files. The most common and most accessible form of publishing on the web is HTML, meaning Hypertext Markup Language. Hypertext means I mention another document somewhere else and show where it is. An old example of hypertext is the table of contents in a book: Chapter 2 is about X, and begins on page 55. On the web hypertext means a link: click here to see something else. Markup Language means that you simply type text like you would in an email, only with special characters that are hidden but have meaning to the program that is used to view the file. These special hidden characters are called the markup tags. HTML is easy to learn because it only has about a hundred tags and most people only use a part of that; I use about 30 tags so it's easy to learn and even memorize if you do a bit.
To start publishing on the web you need to activate your space at the UW, or else find a place somewhere to put your files where people can get them. Read this if you're at the UW: http://www.washington.edu/computing/web/
When you create your files you will need to remember this stuff:
html, css, xml, javascript, txt files are TEXT files and need uploading in TEXT mode
images & media: jpg, gif, wav, flash, shockwave, mpeg, mp3, etc are BINARY files and need uploading in BINARY mode
To create html, css, xml, js, or txt files you just open a text editor like Notepad or Simpletext, type awaye, then save it with the right extension:
.html for HTML
.css for style sheets
.xml for XML
.js for javascript
.txt for plain text
.shtml for Server Side Includes
.cgi for CGI executables
your file names should have ONLY letters, numbers, _ or -, no spaces. Here are some examples:
image1-small.jpg
entry_4.html
index.html
If you want a page to deliver when you visit your site (instead of listing all of the files in that folder) you've gotta name it index dot something. So name it: index.html if you can't figure out what else to do. Web servers look for the index file in a certain order before they list the contents of the folder. I think it goes like this: index.html index.htm index.shtml index.cgi and so on.
tags
HTML used the less than < and greater than > symbols to indicate there is a tag. Unless the tag has a backslash at the beginning </ tag> it is a start tag, with the slash it becomes a closing tag. Here's an example where I make something bold (using the b for bold tag): <b>bold</b> You can also have a single tag that uses an optional closing slash. This is isn't required but I'm showing it in case you see it: <img src="some-image.gif" />
what they do
So you have this file and you mark it all up with a bazillion tags. What you are doing is creating a structure of information using tag within tag within tag. Here I'll show a generic HTML file, add some comments in grey, and try to show the structure it creates.
<html>
<head>
<title>My Cool Title</title>
</head>
<body bgcolor="white">
<p>Welcome to the webpage</p>
</body>
</html>
With this markup we've created a document that has structure like this:
<html>
<head>
<title>
My Cool Title
</title>
</head>
<body bgcolor="white">
<p>
Welcome to the webpage
</p>
<body>
</html>
We can use a style sheet to work with and assign to this structure visual attributes like position, typographic control, etc. These styles that we use will be inherited (if it works right) by all of the sub/child elements. So I can tell the document that every element within the body that is a font must have some size, and other attributes. This would be inherited to the paragraph we created with the p tags, because it is a sub, or child, element of the body--you can see this in the diagram.
Styles are usually inserted into the head of the html because they are not actual content, they just tell the browser how to make the content look. Styles can be assigned to existing tags that are part of html, they can be assigned as classes by adding an attribute to a tag like this: <p class="someclass">, or they can be assigned to one specific element using an id like this: <p id="someid">.
Styles can get complicated and sophisticated. When you use them you must remember the fact that they are inherited or this will cause you a lot of frustration. So back in the HTML example I gave ealier, any element within the body (the p tag and anything else I use) will inherit the styles I assign to the body, unless I give it a different style that overrides what it is inheriting. The syntax for style assignments is very simple (I've inserted comments in grey):
p {some-style:some-value;some-others:other-values}
.someclass {some-style:some-value;some-others:other-values}
#someid {some-style:some-value;some-others:other-values}
You can combine these too, so if you wanted p tags with the someclass and not other p tags to use the style, and you also wanted the someid to all have the same styles you could do this:
p.someclass,#someid {some-style:some-value;some-others:other-values}
For more info on styles read the linked stuff, view other people's style sheets, or read the spec you're interested in at w3.org. Regardless of what you do keep in mind that Netscape 4 will probably not like your initial attempts to use stylesheets.
web publishing links
here is a very short intro to html
more on html
CSS intro, very short too
web typography article,
web type legibility
type control/sizing, html vs css, etc
a ton of stuff here
Netscape webpublishing info
Usability considerations
CSS 2
HTML 4.01
Apache.org search for an ssi tutorial if interested in server side processing/includes
Mozilla web browser, very cool
best source for all browsers: evolt.org
webmonkey.com the best source for info on web publishing
You can see if your web files validate with the World Wide Web Consortium:
file restores
Be careful with this command. It can mess up your stuff. All of it. Call 206.543.5970 or email help@washington.edu to have someone else do it for you.
You can do your own file restores using the command 'recover'. It is sort
of weird depending on how familiar you are with UNIX. There are only 7 or
so days of backups kept around, sometimes more by accident, and they're created nightly--unless something breaks--or your stuff isn't set to backup (got a .nodump file?). To use the
command just go to the shell (as I've described previously) and then type:
recover. The utility will walk through a series of options. If you
are not familiar with Dante read the man page first, or use the help info
in the program, just type this at the shell: man recover, or you
will see the ? for help option when you start the program. To quit
the program just type q to quit. Recover will access the tape
backups (it is sort of slow because it is in a huge tape silo) and then it
will (unless you override the default) place the old backed-up files into
a folder called 'restore'. You just select what folders the files were in,
then the date from which you would like to restore the file, then what
file(s) or folder(s) you want restored....and then it will slowly do it,
usually takes a minute or more depending on how much you are restoring.