| Directory commands | |
| pwd | Print the current (working) directory. |
| mkdir dir | Make directory dir. |
| cd dir | Change (the current) directory to dir. If dir is "..", change to the parent of the current directory. |
| rmdir dir | Remove directory dir, as long as it is empty. |
| File commands | |
| ls | List the files and directories in the current directory. |
| ls -l | List files with long information. (Specifically permissions, owner, group, size, and time last changed.) |
| ls dir | List the files in directory dir. |
| mv file1 file2 | Move file1 to file2. (file2 is overwritten.) |
| mv files dir | Move files into directory dir. |
| rm files | Remove files. Make sure you have said goodbye to these files. They cannot be undeleted. |
| CS1 commands | |
| scheme | Run MIT Scheme. |
| submit labn dir | Submit the files in dir as lab #n. If you leave dir out, submit the files in the subdirectory named "labn". Any previous submissions will be overwritten. |
| submit labn files | Submit files as lab #n. Any previous submissions will be overwritten. |
| Miscellaneous commands | |
| echo address > .forward | Start forwarding your UGCS email to address. |
| cat .forward | See where your UGCS email is being forwarded to. |
| gvim file | Start editing file in gui vim. |
| xemacs file& | Start editing file in Xemacs. |
This is a brief summary of how Scheme is conventionally formatted. Remember, this is only a guide; half of good style is knowing when to break the rules. Also keep in mind that Dr. Scheme's "Reindent" (the current line or selected text) and "Reindent All" commands in the Scheme menu will get you started by, well, reindenting your program.
Always use whitespace between expressions. That means between a ")" and a "(". Often, the second expression belongs on a new line.
Usually, indent new lines in an expression by two spaces:
(define (foo x y) (+ x y) (- x y) (* x y) (/ x y) )
I like to put the closing ")" on its own line, since you can have many lines in the define.
For an if command, put the condition on the same line as if, put the true expression on the next line, and put the false expression on the line after that, like so:
(if (< x y) (foo) (bar))
In this case, Dr. Scheme indents the subexpressions to line up with the beginning of the condition. I put the closing ")" at the end of the last line because if can't have more than two subexpressions.
For a cond command, use "[" and "]"'s for the cases, and start each one on a new line:
(cond [(< x y) (foo)] [(= x y) (bar x y)] [(> x y) (baz y x)] )