Slide 1Slide 2Slide 3Slide 4Slide 5Slide 6Slide 7Slide 8Slide 9Slide 10Slide 11Slide 12Slide 13Slide 14Slide 15Slide 16Linux, vi, and Scala1-14-2011Opening DiscussionHave you come up with any new questions about class?Minute EssaysSignificance of being good with computers.Remembering information from the class after it is done.Comparing Scala to Matlab.Taking this class is definitely a good idea.Playing around.Will we be making websites or games?More Minute EssaysHow many hours per week will you spend on this course?EPUB?Fixing the hate-love relationship with programming.SemicolonsLinuxGo ahead and log in.Linux is just another OS, like Windows or Mac OS.Linux is primarily used in servers. Efforts are being put into making it a desktop OS.It has a GUI, but we will focus on doing things through the command line.Bring up a terminal.Change password with passwd.Command LineYou are likely used to the point and click interface of a GUI.To run a program you double click on it or a file associated with it. Any other information has to be given after the program opens.With the command line you type in the name of the program you want to run. You can also specify any other information you want through command line arguments.Files and DirectoriesWhat you call folders were originally directories.Commands:pwd – See current directory.ls – List the contents of a directory.mkdir/rmdir – Make and remove directories.cp/mv/rm – Copy, move, remove files.less/more/cat – See contents of files.TipsTab completion for file/directory names.! - for last matching command.Ctrl-r to search your history.The man command for manual entries. Use the -k option to search.PermissionsDo ls with -l option to see permissions.Sets of rwx for user, group, and others.Use whoami and groups to find identity.Use chmod and chown to change permissions or ownership.RemoteUse ssh to login into one machine from another.Use scp to copy files from one machine to another.The website has a link to Putty which will give you these abilities from Windows.Otherdu – Lists disk usagegrep – Searches for something inside of files.find – Find files.head – List the first several lines of a file.tail – List the last several lines of a file.top – Look at what is running on a machine.w – Look at who is logged into a machine.I/O RedirectionYou can send a programs output to a file using > or >>.You can make a program use a file as input using <.You can do more interesting things by sending the output of one program to another with |.Text Files/EditorsPrograms are typically written as plain text files and should be edited with a text editor.Notepad is a basic text editor on Windows.Word is NOT a text editor.Some text editors are better than others for programming.In this class we will use vi.viThe vi editor is standard on Linux which is one reason we like to use it.It is also good for programming.Has modes. Start in command mode. You type in an edit mode.i – insertI – insert at beginning of linea – appendA – append at end of lineR – replace charactersOther Commandsx – delete charactersdd – delete/cut linesyy – yank/copy linesp or P – paste before or afterr – replace a single characterJ – join lines/ and n – search for something and nextcw – change a word. - repeat last commandu and Crtl-r – Undo and redoScala Script/First ProgramLet's make a directory and use vi to write our first Scala program then run it.The standard first program is “Hello World” and I don't want to break with tradition.Minute EssayNo class Monday, but the first IcP will be shown on Wednesday.What are your first impressions of command
View Full Document