Paul Johnson POLS909 labExample2.txt Open any kind of terminal you like to use. First, understand "mount point". All devices are mounted at locations that appear to be directories. Conisder floppy disks: [pjohnson@pols08 pjohnson]$ ls blake site-start.el what2 what3 [pjohnson@pols08 pjohnson]$ mount /mnt/floppy/ [pjohnson@pols08 pjohnson]$ mount /mnt/floppy/ [pjohnson@pols08 pjohnson]$ ls /mnt/floppy/ [pjohnson@pols08 pjohnson]$ cd /mnt/floppy [pjohnson@pols08 floppy]$ ls -la total 8 drwxrwxr-x 2 pjohnson pjohnson 7168 Dec 31 1969 . drwxr-xr-x 4 root root 1024 Feb 6 11:00 .. [pjohnson@pols08 floppy]$ cd [pjohnson@pols08 floppy]$ cp site-start.el /mnt/floppy [pjohnson@pols08 floppy]$ cd /mnt/floppy [pjohnson@pols08 floppy]$ ls Here's a shortcut for finding your home's contents [pjohnson@pols08 floppy] ls ~ [pjohnson@pols08 floppy] mkdir ~/whatever [pjohnson@pols08 floppy] cp a_file_name ~/whatever That should move it over to your home. [pjohnson@pols08 floppy]$ umount /mnt/floppy/ umount: /mnt/floppy: device is busy [pjohnson@pols08 floppy]$ cd [pjohnson@pols08 pjohnson]$ umount /mnt/floppy/ If you put in a cd rom, your computer may have software to "automatically" mount it. So put in the cd, wait a moment, see if it pops up a menu offering to run the cd for you. I say NO. If the CD is mounted, it will show under /mnt/cdrom If you don't have automatic mounting, you put in the cdrom and manually mount it like: [pjohnson@pols08 pjohnson]$ mount /mnt/cdrom [pjohnson@pols08 pjohnson]$ ls /mnt/cdrom [pjohnson@pols08 pjohnson]$ cd /mnt/cdrom [pjohnson@pols08 pjohnson]$ cd [pjohnson@pols08 pjohnson]$ umount /mnt/cdrom #now use command line ftp to get a file #first, go back to your home dir. [pjohnson@pols08 pjohnson]$ cd [pjohnson@pols08 pjohnson]$ ftp ftp.swarm.org Connected to ftp.swarm.org (192.12.12.17). 220 chaco FTP server ready. Name (ftp.swarm.org:pjohnson): anonymous 331 Guest login ok, send your complete e-mail address as password. Password: ************ 230-********************************************************************** 230-*** *** 230-*** Welcome to the Santa Fe Institue *** 230-*** FTP Server *** 230-*** *** 230-*** Please direct questions/comments *** 230-*** to: ftp@santafe.edu *** 230-*** *** 230-********************************************************************** 230- 230 Guest login ok, access restrictions apply. Remote system type is UNIX. Using binary mode to transfer files. ftp> ls 227 Entering Passive Mode (192,12,12,17,114,97) 150 Opening ASCII mode data connection for /bin/ls. total 12 lrwxrwxrwx 1 root bin 9 Aug 14 2002 bin -> ./usr/bin d--x--x--x 2 root sys 512 Aug 14 2002 dev d--x--x--x 5 root sys 512 Aug 14 2002 etc drwxr-xr-x 78 root other 1536 Jul 26 2002 pub d--x--x--x 6 root sys 512 Aug 14 2002 usr 226 Transfer complete. ftp> cd pub ftp> cd swarm ftp> cd apps ftp> cd objc ftp> ls ftp> cd sdg ftp> ls 227 Entering Passive Mode (192,12,12,17,170,71) 150 Opening ASCII mode data connection for /bin/ls. total 400 -rw-rw-r-- 1 915 133 10940 Nov 2 2001 gridturtle-2.1.tar.gz -rw-rw-r-- 1 915 133 456 Nov 15 2001 gridturtle.lsm drwxrwxr-x 2 915 133 1024 Nov 15 2001 oldVersions -rw-rw-r-- 1 915 133 24167 Nov 2 2001 sss-2.1.tar.gz -rw-rw-r-- 1 915 133 443 Nov 15 2001 sss.lsm -rw-rw-r-- 1 915 133 153695 Nov 2 2001 swarmapps-2.1.1.tar.gz -rw-rw-r-- 1 915 133 485 Nov 15 2001 swarmapps.lsm drwxrwxr-x 2 915 133 512 Dec 13 2001 testing 226 Transfer complete. ftp> bin . ftp> mget swarmapps-2.1* mget swarmapps-2.1.1.tar.gz? y ftp> quit [pjohnson@pols08 pjohnson]$ ls blake site-start.el swarmapps-2.1.1.tar.gz what2 what3 [pjohnson@pols08 pjohnson]$ mkdir swarm [pjohnson@pols08 pjohnson]$ mv swarmapps-2.1.1.tar.gz swarm [pjohnson@pols08 pjohnson]$ cd swarm [pjohnson@pols08 swarm]$ mkdir OtherPeoplesCode [pjohnson@pols08 swarm]$ mv swarmapps-2.1.1.tar.gz OtherPeoplesCode/ [pjohnson@pols08 swarm]$ ls OtherPeoplesCode [pjohnson@pols08 swarm]$cd OtherPeoplesCode/ [pjohnson@pols08 OtherPeoplesCode]$ ls swarmapps-2.1.1.tar.gz [pjohnson@pols08 OtherPeoplesCode]$ tar tzvf swarmapps-2.1.1.tar.gz drwxr-xr-x mgd/users 0 2000-04-10 17:37:52 swarmapps-2.1.1/ drwxr-xr-x mgd/users 0 2000-04-10 17:37:15 swarmapps-2.1.1/heatbugs/ [pjohnson@pols08 OtherPeoplesCode]$ tar xzvf swarmapps-2.1.1.tar.gz [pjohnson@pols08 OtherPeoplesCode]$ cd swarmapps-2.1.1 [pjohnson@pols08 swarmapps-2.1.1]$ ls heatbugs hello-world market mousetrap template tutorial [pjohnson@pols08 swarmapps-2.1.1]$ cd heatbugs/ [pjohnson@pols08 heatbugs]$ make Makefile:11: ../swarm-2.1.1/etc/swarm/Makefile.appl: No such file or directory make: *** No rule to make target `../swarm-2.1.1/etc/swarm/Makefile.appl'. Stop. [pjohnson@pols08 heatbugs]$ export SWARMHOME=/usr [pjohnson@pols08 heatbugs]$ make gcc -c -g -O2 -march=i386 -mcpu=i686 -Wall -Wno-import -Wno-protocol -Werror -D_GNU_SOURCE -DAPPNAME=heatbugs -DAPPVERSION=2.1.1 -DBUGADDRESS=bug-swarm@swarm.org -I/usr/include/swarm Heatbug.m gcc -c -g -O2 -march=i386 -mcpu=i686 -Wall -Wno-import -Wno-protocol -Werror -D_GNU_SOURCE -DAPPNAME=heatbugs -DAPPVERSION=2.1.1 -DBUGADDRESS=bug-swarm@swarm.org -I/usr/include/swarm HeatSpace.m /bin/sh /usr/bin/libtool-swarm --mode link gcc -g -O2 -march=i386 -mcpu=i686 -L/usr/lib/swarm -rpath /usr/lib/swarm -o heatbugs Heatbug.o HeatSpace.o main.o HeatbugModelSwarm.o HeatbugObserverSwarm.o HeatbugBatchSwarm.o -lswarm -lobjc mkdir .libs gcc -g -O2 -march=i386 -mcpu=i686 -o heatbugs Heatbug.o HeatSpace.o main.o HeatbugModelSwarm.o HeatbugObserverSwarm.o HeatbugBatchSwarm.o -L/usr/lib/swarm /usr/lib/swarm/libswarm.so -L/home/pauljohn/LinuxDownloads/redhat/BUILD/swarm-2.1.141.20021019/=with-hdf/src/space -L/home/pauljohn/LinuxDownloads/redhat/BUILD/swarm-2.1.141.20021019/=with-hdf/src/analysis -L/home/pauljohn/LinuxDownloads/redhat/BUILD/swarm-2.1.141.20021019/=with-hdf/src/simtoolsgui -L/home/pauljohn/LinuxDownloads/redhat/BUILD/swarm-2.1.141.20021019/=with-hdf/src/simtools -L/home/pauljohn/LinuxDownloads/redhat/BUILD/swarm-2.1.141.20021019/=with-hdf/src/random -L/home/pauljohn/LinuxDownloads/redhat/BUILD/swarm-2.1.141.20021019/=with-hdf/src/tkobjc -L/home/pauljohn/LinuxDownloads/redhat/BUILD/swarm-2.1.141.20021019/=with-hdf/src/tclobjc -L/home/pauljohn/LinuxDownloads/redhat/BUILD/swarm-2.1.141.20021019/=with-hdf/src/objectbase -L/home/pauljohn/LinuxDownloads/redhat/BUILD/swarm-2.1.141.20021019/=with-hdf/src/activity -L/home/pauljohn/LinuxDownloads/redhat/BUILD/swarm-2.1.141.20021019/=with-hdf/src/defobj -L/home/pauljohn/LinuxDownloads/redhat/BUILD/swarm-2.1.141.20021019/=with-hdf/src/collections -L/home/pauljohn/LinuxDownloads/redhat/BUILD/swarm-2.1.141.20021019/=with-hdf/src/misc -L/home/pauljohn/LinuxDownloads/redhat/BUILD/swarm-2.1.141.20021019/=with-hdf/libobjc -L/usr/lib -L/usr/X11R6/lib /usr/lib/swarm/libspace.so /usr/lib/swarm/libanalysis.so /usr/lib/swarm/libsimtoolsgui.so /usr/lib/swarm/libsimtools.so /usr/lib/swarm/librandom.so /usr/lib/swarm/libtkobjc.so /usr/lib/swarm/libtclobjc.so /usr/lib/swarm/libobjectbase.so /usr/lib/swarm/libactivity.so /usr/lib/swarm/libdefobj.so /usr/lib/swarm/libcollections.so /usr/lib/swarm/libmisc.so -lBLT24 -ltk8.3 -ltcl8.3 -lXpm -lpng /usr/lib/libhdf5.so -lz -lX11 -lm -ldl /usr/lib/swarm/libobjc.so -lgcc -Wl,--rpath -Wl,/usr/lib/swarm -Wl,--rpath -Wl,/usr/lib/swarm -Wl,--rpath -Wl,/usr/lib -Wl,--rpath -Wl,/usr/X11R6/lib [pjohnson@pols08 heatbugs]$ ls ant.png Heatbug.h HeatbugObserverSwarm.h HeatSpace.m ChangeLog Heatbug.m HeatbugObserverSwarm.m HeatSpace.o COPYING HeatbugModelSwarm.h HeatbugObserverSwarm.o main.m HeatbugBatchSwarm.h HeatbugModelSwarm.m heatbugs main.o HeatbugBatchSwarm.m HeatbugModelSwarm.o heatbugs.scm Makefile HeatbugBatchSwarm.o Heatbug.o HeatSpace.h README # PLEASE NOTE. the current working directory is NOT in the PATH. # so you need ./ before the program name. [pjohnson@pols08 heatbugs]$ ./heatbugs [pjohnson@pols08 heatbugs]$ ./heatbugs --help # Study that output [pjohnson@pols08 heatbugs]$ ./heatbugs -b [pjohnson@pols08 heatbugs]$ ./heatbugs -s [pjohnson@pols08 heatbugs]$ emacs Heatbug.m In there, make a change, use the Tools/compile option. In Emacs, do M-x then type shell In that shell, type ./heatbugs Close that shell, close emacs. Here's one nice program to write papers: [pjohnson@pols08 heatbugs]$ [pjohnson@pols08 heatbugs]$ lyx LyX: Creating directory /home/pjohnson/.lyx/ and running configure... LyX: Done! [pjohnson@pols08 heatbugs]$ lyx Edit/Preferences. Turn off "Rescale bitmap fonts" Next, consider the magic of grep. grep is a program that searches for text. if you use that command here, you can find all the places where the file Heatbug.m is mentioned. [pjohnson@pols08 heatbugs]$ grep Heatbug.m * It searches in all files *. If you only want to search in some files, you can restrict: [pjohnson@pols08 heatbugs]$ grep Heatbug.m *.h THat searches only header files. grep can be used to screen output too. Use a "pipe". First, suppose you want a list of all installed software. Do [pjohnson@pols08 heatbugs]$ rpm -qa That gives a big blop. Suppose you just want the files that have swarm in them. [pjohnson@pols08 heatbugs]$ rpm -qa | grep swarm