~~SLIDESHOW~~ ====== Introduction to Linux --- Lab 1 ====== **Module**: EG-253 Practical Internet Technology II **Date of last presentation**: 4th October 2007 **Presented by**: Dr Chris P. Jobling ===== Acknowledgement ===== This lecture is adapted from the lecture created for CS-244 and CS-M74 by Andy Gimblett of the Department of Computer Science. ===== Contents ====== [[eg-253:unixlab1#introduction_to_this_component|Introduction to this Component]] ===== Introduction to this component ===== * Aims and Motivation * Lectures and Assessment * Recommended Reading ===== Aims and Motivation ===== //Aims:// *Understand concepts. *Know how to use tools and commands. //Motivation:// * C, future modules (eg EG-244, EG-252, EG-259, CS-228). * Useful in industry. * Comparative analysis vs. Windows =====Lectures & Assessment ===== * 3 lecture/labs on Linux. * One coursework (10% of EG-253). =====Recommended Reading ===== * //Running Linux// (O'Reilly) * //Linux in a Nutshell// (O'Reilly) * //Introducing UNIX and Linux// (Palgrave Macmillan) * //Linux Documentation Project// (www.tldp.org) * //Introduction to Linux// * //Linux Dictionary// * //Linux Cookbook// * ''man'' pages and GNU ''info'' (see later). \section{Introducing Unix} \subsection{Context \& History} \begin{frame} =====Context \& History --- Unix} \begin{itemize} * 1960s: MULTICS project at AT\&T Bell Labs, abandoned. * 1960s: UNIX an attempt to capture the best bits. * Aims: \begin{itemize} * Portable. * Simple, small, elegant --- but powerful. * Promote code re-use. Small programs, do one thing well. \end{itemize} * Reject ``User Friendly means Easy To Learn''. * Assume user knows what they're doing. \end{itemize} \end{frame} \begin{frame} =====Context \& History --- GNU To Linux} \begin{itemize} * 1980s: Multiple Unix vendors, jealously guarded IP. * //RMS// decides to create an open and free Unix-like OS. * GNU Project --- responsible for loads of great software. * Early 1990s: Linus Torvalds plays with MINIX, decides to have a go. * Internet facilitates collaboration, Linux takes off. * Linux kernel + GNU tools = Linux we know and love. * Lots of flavours, but open so feed off each other. \end{itemize} \end{frame} \subsection{Unix Essentials} \begin{frame} =====System Overview} \begin{center} \includegraphics[angle=270,width=7cm]{linux_organisation} \end{center} \end{frame} \begin{frame} =====Kernel} \begin{itemize} * Central part of OS. * Concerned with managing hardware and other system resources. * Whatever you do, the kernel is involved. * Never accessed directly by user, however. * Provides access to its facilities via \textbf{system calls}. * Really ``Linux'' is just the kernel. \end{itemize} \end{frame} \begin{frame} =====Applications \& Utilities} \begin{itemize} * The programs which access the kernel via system calls. * Things which make system useful and useable. * Basically anything that runs on the system. * One of the two main topics of this course. * Examples: cp, gcc, slogin, gimp * One important class of apps: apps for running other apps. \begin{itemize} * Shells * Graphical Environments \end{itemize} \end{itemize} \end{frame} \begin{frame} =====Shells} \begin{itemize} * The other main topic of this course. * Command-line environment within which other runs are run. * Like the DOS Prompt/Command Prompt in Windows. * Unlike Windows, no single ``best'' shell, instead lots of choice. * De facto standard in Linux is \textbf{bash}, so we look at that. * Others: sh, csh, zsh, tcsh, ksh, etc. \end{itemize} \end{frame} \begin{frame} =====Graphical Environments} \begin{itemize} * X Window --- toolkit for graphics mode programs. * Windows Manager --- provides look-and-feel for programs running under X. * Desktop Environment --- Extra layer providing comfortable \& easy environment for working. * Not really of concern on this course. \end{itemize} \end{frame} \section{Getting Started with Linux} \begin{frame} =====Getting Started} \begin{itemize} * Logging In --- enter username \& password. * Logging Out --- just like Windows. (?) * Menu system --- should be explored. Try things out. * Running a Shell \begin{itemize} * Look for ''Terminal}, \texttt{xterm'', ''shell}, \texttt{bash''. * Ensure you're running ''bash''. * To exit: ''exit} or \texttt{Ctrl-d''. \end{itemize} \end{itemize} \end{frame} \subsection{Essential Commands} \begin{frame} =====Essential Commands (1)} //nb:} \textbf{Case Sensitive!!!// \begin{itemize} * ''ls'' --- List a directory * ''pwd'' --- Print current working directory * ''cd'' --- Change directory * ''cp'' --- Copy a file * ''mv'' --- Move a file, rename a file * ''mkdir'' --- Create a directory * ''rm'' --- Remove a file or directory \end{itemize} \end{frame} \begin{frame} =====Essential Commands (2)} \begin{itemize} * ''ps'' --- Print processes running * ''top'' --- Print top processes running * ''which'' --- Print path to command * ''file'' --- Print type of file * ''cat'' --- Print contents of text file * ''less} / \texttt{more'' --- Read text file one page at a time. \end{itemize} \end{frame} \subsection{Getting Help} \begin{frame} =====Getting Help --- ''man}'' \begin{itemize} * ''man'' pages are canonical source of documentation * ''man ls} to see manual page for \texttt{ls'' * Standard form, hard to read at first, but \textbf{essential} skill. * Chapters: ''ls(1)} means \texttt{ls'' is in chapter 1. * Read from chapter ''n} using \texttt{man 1 ls'' * ''man -k'' to search manual pages for some string. \end{itemize} READ THE MAN PAGES!!! \end{frame} \begin{frame} =====Getting Help --- ''info}'' \begin{itemize} * GNU Project's hypertext-based manual system. * Much more complicated than ''man'' pages. * ''info ls} to get info page for \texttt{ls''. * Hit ''h'' to start an interactive tutorial. * ''info'' on its own for top-level node. \end{itemize} \end{frame} \subsection{Bash Tips \& Tricks} \begin{frame} =====Bash Tips \& Tricks --- History} \begin{itemize} * Bash remembers what commands you've typed. * ''!!'' to repeat last command. * ''!-n'' to repeat nth last command. * Up and down arrows for quick navigation. * ''history'' to print numbered history. * Then ''!n'' to repeat some numbered line. * Ctrl-r to reverse-search through history. \end{itemize} \end{frame} \begin{frame} ====== Bash Tips \& Tricks --- Tab Completion} \begin{itemize} * The Best Thing Since Sliced Bread. * Bash will guess file \& directory names for you when you hit tab. * Guesses as far as it can. Then provide more letters to remove ambiguity. * Will give you all the choices if you keep hitting tab. * An incredible timesaver --- you owe it to yourself to use it. * Can also prevent mistyped filenames. \end{itemize} \end{frame} \end{document} \endinput