include "../_i/1.h"; ?>
Both the Linux OS (www.goshen.edu) and Mac's OS-X are flavors of the Unix operating system.
Work through the emacs tutorial (emacs
, then [ctrl]-h, t)
Open up the Mac 'Finder'. Find the Terminal utility - under "Applications > Utility". Drag it to your system tray and drop it.
Double-click Terminal and you'll find yourself running a command line interpreter (or "shell") called Bash ('Bourne Again SHell)
exit
to see if you still have anything running under your shell, and then close the terminal window.
Bash is a classic example of a user interface (UI) for experts.
ls - 'list' all the files in the current directory (pwd), also ls -l, ls Desktop
Notice that when you first start up Bash on a Unix system you are connected to your home directory. On a Mac this is something like /Users/[your username]. On a Linux system it might be /home/[your username].
/ is the 'root' of the filesystem. Try ls /
ls - 'list' all the files in the current directory,
also ls -l, ls Desktop
pwd - 'print working directory', what directory
am I in presently?
cd Desktop - 'change directory'. Also, cd .. to go 'up' one level, and just cd with no argument to return to your home directory from anywhere.
more [filename]. Shows you the contents of a file. You need to know 3 commands to use more:
[space]
- advances the text one page,b
- go back one page,q
- quit the man page display.
There is reference information available for most Unix commands in the man pages. This command displays the manual information for the pwd
command:
man pwd
When using man, you use the same 3 keys ([space], b,q) as more to move around in the man pages.
Now, we'd like to start working with files, particularly human readable text files. Unix comes with many text file editors, including vi, joe, pico. We'll teach emacs - a well tested (V.23.x) editor that also lets you customize and extend it with 'macros' when you're ready to do that.
Start up emacs without a file name to see help:
emacs
Then hit [ctrl]-h, t
to get the tutorial which you should work through.
emacs hello.html
[ctrl]-x [ctrl]-c
: leave the editor. [ctrl]-x [ctrl]-s
: save the file without leaving emacs.[ctrl]-a, [ctrl]-e
: go to the beginning or end of a line (also works for bash command line editing!)[ctrl]-v, [esc] v
: advance (or go back) by one screen[ctrl]-s, [ctrl]-r
: search forward for some text, or reverse search for some text.On the next page on html we'll use emacs to start messing around with web pages. There are also more tips on using emacs and shell commands.
See also: Gnu Emacs Manual.
include "../_i/3.h" ?>