Working with Unix
To cancel a command in the shell, press Ctrl-C. It almost always works.
- ls
- list files in the current directory
- mkdir proj1
- make a new directory called proj1
- cd proj1
- change current directory to proj1
- cd ..
- change to the parent directory
- cd
- shorthand for cd ~ which means "change to home directory"
- mv twenty-one.scm proj1
- move the file twenty-one.scm to the proj1 directory
- mv homework1.scm hw1.scm
- move (rename) the file homework1.scm to hw1.scm (notice the behavior of mv depends on whether the target is an existing directory!)
- cp ~cs61a/lib/plural.scm .
- copy the file plural.scm in the lib directory in cs61a's home folder to the current directory
- rm lab1
- remove the file lab1 (from the current directory)
- rmdir tmp
- remove the directory called tmp, which must be empty
- firefox &
- start Firefox, in the background — leaving off the ampersand means the shell will wait for Firefox to quit before accepting any more commands
- emacs &
- start Emacs, in the background — ditto Firefox
- emacs hw1.scm &
- start Emacs and edit hw1.scm
- lpr lab1
- print the file lab1 to the nearest inst printer — don't use this logging in from home!
- submit hw1
- submit the files in the current directory for assignment hw1
- glookup -t
- see what you've turned in
- glookup
- check your grades
Working with Emacs
The command C-x C-s is read "control-X control-S" and means "holding control, press X, then release, then holding control, press S". M-s is read "meta-S", and the diamond key (◆) is the meta key. M-x run-scheme means "holding meta, press X, then type run-scheme, then press Return".
Some commands (like creating or opening files) require input in the single line at the bottom of the Emacs window (called the minibuffer). If you're in the middle of such a command, C-g will cancel it.
Many of the menu commands have keyboard shortcuts as well. Some like to use them, some don't. An advantage of learning them is being able to work in a console-based Emacs.
- M-s
- Split the window and run Scheme
- M-x run-scheme
- Run Scheme in the current split (useful if it crashes)
- C-c C-c
- Interrupt a running Scheme program
- M-p and M-n
- At the Scheme prompt, get the previous or next line entered
- C-x u
- Undo — you can get other Edit menu commands from the menu, but this one might bug you for a while
- C-M-q
- If the cursor is at an open paren, reindent everything inside the parens
- C-M-\
- Reindent everything selected
Back to Jordy's home page | Course home page