Getting started with Hugs on Linux

Size: px
Start display at page:

Download "Getting started with Hugs on Linux"

Transcription

1 Getting started with Hugs on Linux CS190 Functional Programming Techniques Dr Hans Georg Schaathun University of Surrey Autumn 2008 Week 1 Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 1 / 43

2 Outline 1 Learning Objectives 2 File tree and command line 3 Software 4 The editor 5 Haskell Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 2 / 43

3 Outline Learning Objectives 1 Learning Objectives 2 File tree and command line 3 Software 4 The editor 5 Haskell Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 3 / 43

4 Learning Objectives Learning Objectives From the module description At the end of the module, the students will be able to work with standard command-line interfaces. write programs employing the fundamental features of Haskell. be able to make and use reusable functions as a fundamental building block of software development. understand recursion and polymorphism and be able to use them in simple algorithm design. contrast functional and imperative languages and understand the advantages and disadvantages of each. Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 4 / 43

5 The lab exercises Learning Objectives Weekly lab sessions one exercise set per week Lab Sheet 1 for next week (preparatory exercises). Portfolios Containing Haskell functions from the weekly labs Must be passed Portfolio 1 (Lab Sheet 2 for Weeks 2-4). Public test script (TBC) Portfolio 2 (Lab Sheet 3 for Weeks 5-8). Secret test script (TBC) Exact details will be announced later. Including assessment criteria See current/cs190/ Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 5 / 43

6 Learning Objectives The exam The mark is decided purely by the exam... though you will fail if you fail on a portfolio 2h written, unseen exam You need the practical understanding from the labs The exercise material is central for the exam If you master the exercises, a catastrophe is unlikely... but the exam will have something extra Extra exercises will help you Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 6 / 43

7 This session Learning Objectives This sessions will give you the basic background to start using the faculty linux system start using the hugs Haskell interpreter During this week you have to try the software in the linux labs make sure that you can use the knowledge from the lecture Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 7 / 43

8 Learning Objectives References A basic book: Programming in Haskell by Graham Hutton A comprehensive book: Haskell: The Craft of Functional Programming by Simon Thompson You ll need one of the books You can download a copy of hugs Reference on Unix/Linux (e.g. Unix in a Nutshell [O Reilly]) Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 8 / 43

9 Outline File tree and command line 1 Learning Objectives 2 File tree and command line 3 Software 4 The editor 5 Haskell Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 9 / 43

10 File tree and command line The command line (shell) Open a terminal window Applications System Terminal... emulates an old-fashioned text terminal (tty) An interpreter (or shell) runs in the terminal reads and interprets commands Different interpreters are available: bash, tcsh, ksh, zsh Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 10 / 43

11 File tree and command line The file tree research/ teaching/ Notes/ labs/ Mail/ bin/ Papers/ work/ Mail/ cs190/ cs168/ css1hs/ cscssst/ css1ht/ eps351/ epsguest/ bin/ lib/ filer2/ filer6/ bin/ man/ local/ home/ tmp/ usr/ / Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 11 / 43

12 File tree and command line Navigating in the tree The files are organised in a tree Each node is either a directory, containing files and/or other directories a file, containing data for some piece of software Current Working Directory your location in the tree Useful commands: pwd : print current directory cd : change directory ls : list directory contents Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 12 / 43

13 Naming a node File tree and command line A file/directory is identified by its path Name each directory traversed to reach the file separated by slashes (/) A relative path starts from the current directory e.g. cs190/test.hs.. identifies the parent directory Absolute paths starts at the root (/) /home/filer6/epsguest/eps351/cs190/test.hs Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 13 / 43

14 File tree and command line Path: /home/filer6/epsguest/eps351/cs190/ research/ teaching/ Notes/ labs/ Mail/ bin/ Papers/ work/ Mail/ cs190/ cs168/ css1hs/ cscssst/ css1ht/ eps351/ epsguest/ bin/ lib/ filer2/ filer6/ bin/ man/ local/ home/ tmp/ usr/ / Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 14 / 43

15 File tree and command line Modifying the tree mkdir : make new directory rmdir : remove (empty) directory rm : remove file cp : copy file mv : move file For more information you can use the man pages man cp man man It takes some time to learn to read the man pages though Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 15 / 43

16 File information File tree and command line % ls -l total 12 drwxr-sr-x 2 eps351 epsguest 4096 Aug 6 13:25 labs/ drwxr-sr-x 2 eps351 epsguest 4096 Aug 6 13:25 Notes/ -rw eps351 epsguest 0 Aug 6 13:26 test2.h -rw-r--r-- 1 eps351 epsguest 8 Aug 6 13:25 test.hs File type: d for directory, - for regular file Nine characters for mode (access permissions) Number of links to the file File owner (eps351) and group (epsguest) File size (bytes) Time of last modification Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 16 / 43

17 File tree and command line File mode (access permissions) drwxr-sr-x 2 eps351 epsguest 4096 Aug 6 13:25 Notes/ Three user classes: user/owner (char 2-4) group (char 5-7) others (char 8-10) Three access rights: r for read w for write x (or s) for execute (programs) or open (directories) chmod : change mode chmod g+w test.hs gives (+) the group (g) the write access (w) u/g/o/a [+/-/=] [r/w/x] Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 17 / 43

18 Outline Software 1 Learning Objectives 2 File tree and command line 3 Software 4 The editor 5 Haskell Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 18 / 43

19 Running other software Software Any program can be launched from the command line Some create their own window: firefox & emacs & Some run in the terminal and shell: man man vim myfile.hs find. -name myexercise.hs -print Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 19 / 43

20 Software Background and Foreground What does the ampersand mean? Starting a program in the foreground: emacs Starting a program in the background: emacs & Only have one foreground process and then, it cannot do anything else When a program runs in the background, the shell continues doing other things (i.e. new prompt) Programs running in the terminal window needs the foreground Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 20 / 43

21 Software Background and Foreground What does the ampersand mean? Starting a program in the foreground: emacs Starting a program in the background: emacs & Only have one foreground process and then, it cannot do anything else When a program runs in the background, the shell continues doing other things (i.e. new prompt) Programs running in the terminal window needs the foreground Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 20 / 43

22 Software Background and Foreground What does the ampersand mean? Starting a program in the foreground: emacs Starting a program in the background: emacs & Only have one foreground process and then, it cannot do anything else When a program runs in the background, the shell continues doing other things (i.e. new prompt) Programs running in the terminal window needs the foreground Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 20 / 43

23 Software Moving to the background Special keys in the terminal only Interrupt: Ctrl-C (terminates the program) Suspend: Ctrl-Z (program stops, but can rewake) Rewaking a process: Background: bg Foreground: fg List jobs: jobs bg %jobno. If you forget the ampersand: Ctrl-Z + bg If you suspend a terminal program: fg Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 21 / 43

24 Software Processes and kill List processes: Current terminal: ps All: ps xg Note PID (process ID) to the left Kill a process: Terminate: kill PID or kill %jobno. Kill: kill -KILL (and PID or job no.) Dynamic process list: top shows resource expenditure If a process malfunctions, you can kill it. Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 22 / 43

25 Outline The editor 1 Learning Objectives 2 File tree and command line 3 Software 4 The editor 5 Haskell Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 23 / 43

26 The editor The editor The editor is our most important tool Edit plain text files in Haskell, Java, C, English, HTML no special formatting (i.e. not a word-processor) Use your favourite editor emacs, vim, pico, etc. Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 24 / 43

27 The editor emacs Straight forward for most users Uni-modal editor Runs in a separate window (with menus etc.) It is a powerful tool Advanced editing Macros Plugins for , news, etc Advanced features are hard to learn and few use them Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 25 / 43

28 The editor vim Bimodal editor Alien for many users Many commands at few key strokes Command mode all keys are used for commands (movement, replace, etc) Insert mode Typed text is added to the file Runs on the command line: very fast Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 26 / 43

29 The editor Basics in vim/vi Start it: vim filename.hs Command mode Insert mode: i, I, a, A, o, O Insert mode Command mode: Esc Colon commands are followed by return: Quit: :q (:q! forced) Save and quit: :wq Search and replace: :%s/old/new/g Delete: x, X (character), dd (line) Replace: r (character), R (several character (insert mode)) See a full tutorial on the web page. Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 27 / 43

30 The editor Starting the editor on a file A file can be given on the command line vi myfile.hs starts vi on the given file Editors running in the terminal (vi, pico) are almost always started this way You can also run emacs myfile.hs but many prefer loading the files from the menus because emacs is heavy, subsequent files should be loaded from the menu quitting and restarting is impractical vi users often prefer quit and restart Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 28 / 43

31 Outline Haskell 1 Learning Objectives 2 File tree and command line 3 Software 4 The editor 5 Haskell Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 29 / 43

32 Haskell The interpreter Start hugs on the command line different prompt Reads and interprets commands and expressions :load module.hs 56+3*9-7 "Hello World!" "Hello" ++ ", " ++ "George" You can use it straight away as a calculator... but you d rather want to make your own module with advanced features Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 30 / 43

33 Expressions Haskell An expression can be A single number: 42 or 12.4 An operator with arguments: or 54.2/3 A function call: sqrt 12 ( 12) When you type an expresion, it is evaluated, i.e. functions and operators are applied to produce a result the result is displayed if possible Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 31 / 43

34 What is a function? Haskell x 1 function y 1 View the function as a machine A value x 1 comes in A value y 1 is returned Using a function, it is a black box You don t know what happens inside You see only the output y 1. Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 32 / 43

35 What is a function? Haskell x 1 function y 1 View the function as a machine A value x 1 comes in A value y 1 is returned Using a function, it is a black box You don t know what happens inside You see only the output y 1. Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 32 / 43

36 For example? Haskell 2 sqrt ( ) Main> sqrt Main> Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 33 / 43

37 Functional programming Haskell Functions are the fundamental building block in functional programming Contrary to imperative programming (e.g. Java)... where data objects are the building blocks During the module we will see how functions return functions functions are arguments to functions Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 34 / 43

38 Haskell Scripts Defining functions and constants Haskell Haskell scripts: e.g. demo.hs Edit scripts using an editor (vim, emacs) Load the script in hugs using :load The script contains definitions not expressions Note that you cannot make definitions on the command line only expressions Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 35 / 43

39 Haskell Scripts Defining functions and constants Haskell Haskell scripts: e.g. demo.hs Edit scripts using an editor (vim, emacs) Load the script in hugs using :load The script contains definitions not expressions Note that you cannot make definitions on the command line only expressions Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 35 / 43

40 Haskell Definitions and declarations Declaration: myname :: String Definition: myname = "George" This is not similar to Java = denotes equality it is a universal truth in Java = denotes an assignment and myname could then be reassigned a definition is done once and for all Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 36 / 43

41 Haskell Definitions and declarations Declaration: myname :: String Definition: myname = "George" This is not similar to Java = denotes equality it is a universal truth in Java = denotes an assignment and myname could then be reassigned a definition is done once and for all Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 36 / 43

42 Haskell Function definitions treble :: treble x = 3*x Int -> Int Hugs> :load 01intro/demo.hs Main> myname "George" Main> treble 5 15 Main> treble 4.3 ERROR - Cannot infer instance *** Instance : Fractional Int *** Expression : treble 4.3 Main> Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 37 / 43

43 Haskell Lists mylist :: [Int] mylist = [12, 15, 24, 14, 12, 6] Standard functions and operators exist for lists Main> mylist!!2 24 Main> reverse mylist [6,12,14,24,15,12] Main> drop 4 mylist [12,6] Main> drop (2*2) (reverse mylist) [15,12] Main> Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 38 / 43

44 Haskell Naming requirements Haskell is case sensitive Haskell is case sensitive mylist and mylist are different variables Case gives information about the identifier all variables start with lower-case : mylist all type identifiers start with upper-case : Int If you forget this, you will get confusing error messages... Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 39 / 43

45 Haskell The layout rule How does the interpreter know where a definition ends? In Java this is marked by a semicolon (;) Haskell uses layout, i.e. indentation fun x y = a long and winding expression in x + y fun2 x y = another function in x and y lines with extra indentation continues the definition any text in the same column or to the left marks a new definition Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 40 / 43

46 Haskell Good practice Use indentation consistently Try to make it easy to read max x y x > y = x otherwise = y Align the guards ( ) and the equal signs (=) Layout is mainly a question of personal style... but please think of the reader Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 41 / 43

47 Comments Haskell Good practice: comment your code Comment starts with - and ends at the end of line - the compiler ignore comments like this Comments are for human readers explain your code make it easy to understand Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 42 / 43

48 Summary Haskell Quick overview of basic features and tools needed You will have to test it all on the computer lab sessions and in your own time This week s material is basic you have to master it Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn 2008Week 1 43 / 43

Getting started with Hugs on Linux

Getting started with Hugs on Linux Getting started with Hugs on Linux COM1022 Functional Programming Techniques Dr Hans Georg Schaathun University of Surrey Autumn 2009 Week 7 Dr Hans Georg Schaathun Getting started with Hugs on Linux Autumn

More information

Mills HPC Tutorial Series. Linux Basics I

Mills HPC Tutorial Series. Linux Basics I Mills HPC Tutorial Series Linux Basics I Objectives Command Line Window Anatomy Command Structure Command Examples Help Files and Directories Permissions Wildcards and Home (~) Redirection and Pipe Create

More information

A Brief Introduction to Unix

A Brief Introduction to Unix A Brief Introduction to Unix Sean Barag Drexel University March 30, 2011 Sean Barag (Drexel University) CS 265 - A Brief Introduction to Unix March 30, 2011 1 / 17 Outline 1 Directories

More information

Perl and R Scripting for Biologists

Perl and R Scripting for Biologists Perl and R Scripting for Biologists Lukas Mueller PLBR 4092 Course overview Linux basics (today) Linux advanced (Aure, next week) Why Linux? Free open source operating system based on UNIX specifications

More information

Unix/Linux Basics. Cpt S 223, Fall 2007 Copyright: Washington State University

Unix/Linux Basics. Cpt S 223, Fall 2007 Copyright: Washington State University Unix/Linux Basics 1 Some basics to remember Everything is case sensitive Eg., you can have two different files of the same name but different case in the same folder Console-driven (same as terminal )

More information

CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX

CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX This handout very briefly describes how to use Unix and how to use the Linux server and client machines in the EECS labs that dual boot

More information

CS Fundamentals of Programming II Fall Very Basic UNIX

CS Fundamentals of Programming II Fall Very Basic UNIX CS 215 - Fundamentals of Programming II Fall 2012 - Very Basic UNIX This handout very briefly describes how to use Unix and how to use the Linux server and client machines in the CS (Project) Lab (KC-265)

More information

CSCI 2132 Software Development. Lecture 4: Files and Directories

CSCI 2132 Software Development. Lecture 4: Files and Directories CSCI 2132 Software Development Lecture 4: Files and Directories Instructor: Vlado Keselj Faculty of Computer Science Dalhousie University 12-Sep-2018 (4) CSCI 2132 1 Previous Lecture Some hardware concepts

More information

CISC 220 fall 2011, set 1: Linux basics

CISC 220 fall 2011, set 1: Linux basics CISC 220: System-Level Programming instructor: Margaret Lamb e-mail: malamb@cs.queensu.ca office: Goodwin 554 office phone: 533-6059 (internal extension 36059) office hours: Tues/Wed/Thurs 2-3 (this week

More information

Chapter-3. Introduction to Unix: Fundamental Commands

Chapter-3. Introduction to Unix: Fundamental Commands Chapter-3 Introduction to Unix: Fundamental Commands What You Will Learn The fundamental commands of the Unix operating system. Everything told for Unix here is applicable to the Linux operating system

More information

Introduction to Linux. Woo-Yeong Jeong Computer Systems Laboratory Sungkyunkwan University

Introduction to Linux. Woo-Yeong Jeong Computer Systems Laboratory Sungkyunkwan University Introduction to Linux Woo-Yeong Jeong (wooyeong@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu What is Linux? A Unix-like operating system of a computer What is an

More information

Introduction to Linux

Introduction to Linux Introduction to Linux Mukesh Pund Principal Scientist, NISCAIR, New Delhi, India History In 1969, a team of developers developed a new operating system called Unix which was written using C Linus Torvalds,

More information

Read the relevant material in Sobell! If you want to follow along with the examples that follow, and you do, open a Linux terminal.

Read the relevant material in Sobell! If you want to follow along with the examples that follow, and you do, open a Linux terminal. Warnings 1 First of all, these notes will cover only a small subset of the available commands and utilities, and will cover most of those in a shallow fashion. Read the relevant material in Sobell! If

More information

CSC209H Lecture 1. Dan Zingaro. January 7, 2015

CSC209H Lecture 1. Dan Zingaro. January 7, 2015 CSC209H Lecture 1 Dan Zingaro January 7, 2015 Welcome! Welcome to CSC209 Comments or questions during class? Let me know! Topics: shell and Unix, pipes and filters, C programming, processes, system calls,

More information

First of all, these notes will cover only a small subset of the available commands and utilities, and will cover most of those in a shallow fashion.

First of all, these notes will cover only a small subset of the available commands and utilities, and will cover most of those in a shallow fashion. Warnings 1 First of all, these notes will cover only a small subset of the available commands and utilities, and will cover most of those in a shallow fashion. Read the relevant material in Sobell! If

More information

Commands are in black

Commands are in black Starting From the Shell Prompt (Terminal) Commands are in black / +--------+---------+-------+---------+---------+------ +------ +------ +------ +------ +------ +-- Bin boot dev etc home media sbin bin

More information

Getting Started. Running Utilities. Shells. Special Characters. Special Characters. Chapter 2 Unix Utilities for non-programmers

Getting Started. Running Utilities. Shells. Special Characters. Special Characters. Chapter 2 Unix Utilities for non-programmers Chapter 2 Unix Utilities for non-programmers Graham Glass and King Ables, UNIX for Programmers and Users, Third Edition, Pearson Prentice Hall, 2003. Original Notes by Raj Sunderraman Converted to presentation

More information

Linux Systems Administration Getting Started with Linux

Linux Systems Administration Getting Started with Linux Linux Systems Administration Getting Started with Linux Network Startup Resource Center www.nsrc.org These materials are licensed under the Creative Commons Attribution-NonCommercial 4.0 International

More information

Unix Basics. Systems Programming Concepts

Unix Basics. Systems Programming Concepts Concepts Unix directories Important Unix file commands man, pwd, ls, mkdir, cd, cp, mv File and directory access rights through permission settings Using chmod to change permissions Other important Unix

More information

Systems Programming and Computer Architecture ( ) Exercise Session 01 Data Lab

Systems Programming and Computer Architecture ( ) Exercise Session 01 Data Lab Systems Programming and Computer Architecture (252-0061-00) Exercise Session 01 Data Lab 1 Goal Get familiar with bit level representations, C and Linux Thursday, September 22, 2016 Systems Programming

More information

commandname flags arguments

commandname flags arguments Unix Review, additional Unix commands CS101, Mock Introduction This handout/lecture reviews some basic UNIX commands that you should know how to use. A more detailed description of this and other commands

More information

EECS Software Tools. Lab 2 Tutorial: Introduction to UNIX/Linux. Tilemachos Pechlivanoglou

EECS Software Tools. Lab 2 Tutorial: Introduction to UNIX/Linux. Tilemachos Pechlivanoglou EECS 2031 - Software Tools Lab 2 Tutorial: Introduction to UNIX/Linux Tilemachos Pechlivanoglou (tipech@eecs.yorku.ca) Sep 22 & 25, 2017 Material marked with will be in your exams Sep 22 & 25, 2017 Introduction

More information

Introduction: What is Unix?

Introduction: What is Unix? Introduction Introduction: What is Unix? An operating system Developed at AT&T Bell Labs in the 1960 s Command Line Interpreter GUIs (Window systems) are now available Introduction: Unix vs. Linux Unix

More information

Lezione 8. Shell command language Introduction. Sommario. Bioinformatica. Mauro Ceccanti e Alberto Paoluzzi

Lezione 8. Shell command language Introduction. Sommario. Bioinformatica. Mauro Ceccanti e Alberto Paoluzzi Lezione 8 Bioinformatica Mauro Ceccanti e Alberto Paoluzzi Dip. Informatica e Automazione Università Roma Tre Dip. Medicina Clinica Università La Sapienza Sommario Shell command language Introduction A

More information

15-122: Principles of Imperative Computation

15-122: Principles of Imperative Computation 15-122: Principles of Imperative Computation Lab 0 Navigating your account in Linux Tom Cortina, Rob Simmons Unlike typical graphical interfaces for operating systems, here you are entering commands directly

More information

Crash Course in Unix. For more info check out the Unix man pages -orhttp://www.cs.rpi.edu/~hollingd/unix. -or- Unix in a Nutshell (an O Reilly book).

Crash Course in Unix. For more info check out the Unix man pages -orhttp://www.cs.rpi.edu/~hollingd/unix. -or- Unix in a Nutshell (an O Reilly book). Crash Course in Unix For more info check out the Unix man pages -orhttp://www.cs.rpi.edu/~hollingd/unix -or- Unix in a Nutshell (an O Reilly book). 1 Unix Accounts To access a Unix system you need to have

More information

Linux Tutorial #6. -rw-r csce_user csce_user 20 Jan 4 09:15 list1.txt -rw-r csce_user csce_user 26 Jan 4 09:16 list2.

Linux Tutorial #6. -rw-r csce_user csce_user 20 Jan 4 09:15 list1.txt -rw-r csce_user csce_user 26 Jan 4 09:16 list2. File system access rights Linux Tutorial #6 Linux provides file system security using a three- level system of access rights. These special codes control who can read/write/execute every file and directory

More information

Introduction to Unix: Fundamental Commands

Introduction to Unix: Fundamental Commands Introduction to Unix: Fundamental Commands Ricky Patterson UVA Library Based on slides from Turgut Yilmaz Istanbul Teknik University 1 What We Will Learn The fundamental commands of the Unix operating

More information

Session 1: Accessing MUGrid and Command Line Basics

Session 1: Accessing MUGrid and Command Line Basics Session 1: Accessing MUGrid and Command Line Basics Craig A. Struble, Ph.D. July 14, 2010 1 Introduction The Marquette University Grid (MUGrid) is a collection of dedicated and opportunistic resources

More information

Lezione 8. Shell command language Introduction. Sommario. Bioinformatica. Esercitazione Introduzione al linguaggio di shell

Lezione 8. Shell command language Introduction. Sommario. Bioinformatica. Esercitazione Introduzione al linguaggio di shell Lezione 8 Bioinformatica Mauro Ceccanti e Alberto Paoluzzi Esercitazione Introduzione al linguaggio di shell Dip. Informatica e Automazione Università Roma Tre Dip. Medicina Clinica Università La Sapienza

More information

Linux File System and Basic Commands

Linux File System and Basic Commands Linux File System and Basic Commands 0.1 Files, directories, and pwd The GNU/Linux operating system is much different from your typical Microsoft Windows PC, and probably looks different from Apple OS

More information

Working with Basic Linux. Daniel Balagué

Working with Basic Linux. Daniel Balagué Working with Basic Linux Daniel Balagué How Linux Works? Everything in Linux is either a file or a process. A process is an executing program identified with a PID number. It runs in short or long duration

More information

acmteam/unix.pdf How to manage your account (user ID, password, shell); How to compile C, C++, and Java programs;

acmteam/unix.pdf How to manage your account (user ID, password, shell); How to compile C, C++, and Java programs; Note: you can find this file under: http://www.cs.queensu.ca/ acmteam/unix.pdf Introduction to Unix Tutorial In this tutorial, you will learn: How to manage your account (user ID, password, shell); Navigating

More information

Virtual Machine. Linux flavor : Debian. Everything (except slides) preinstalled for you. https://www.virtualbox.org/

Virtual Machine. Linux flavor : Debian. Everything (except slides) preinstalled for you. https://www.virtualbox.org/ Virtual Machine Anyone have problems installing it? VM: Virtual Box - allows you to run a different operating system within the current operating system of your machine. https://www.virtualbox.org/ Linux

More information

Files and Directories

Files and Directories CSCI 2132: Software Development Files and Directories Norbert Zeh Faculty of Computer Science Dalhousie University Winter 2019 Files and Directories Much of the operation of Unix and programs running on

More information

Linux/Cygwin Practice Computer Architecture

Linux/Cygwin Practice Computer Architecture Linux/Cygwin Practice 2010 Computer Architecture Linux Login Use ssh client applications to connect (Port : 22) SSH Clients zterm ( http://www.brainz.co.kr/products/products4_2.php ) Putty ( http://kldp.net/frs/download.php/3411/hangulputty-0.58.h2.exe

More information

The Unix Shell & Shell Scripts

The Unix Shell & Shell Scripts The Unix Shell & Shell Scripts You should do steps 1 to 7 before going to the lab. Use the Linux system you installed in the previous lab. In the lab do step 8, the TA may give you additional exercises

More information

CENG 334 Computer Networks. Laboratory I Linux Tutorial

CENG 334 Computer Networks. Laboratory I Linux Tutorial CENG 334 Computer Networks Laboratory I Linux Tutorial Contents 1. Logging In and Starting Session 2. Using Commands 1. Basic Commands 2. Working With Files and Directories 3. Permission Bits 3. Introduction

More information

Linux Command Line Interface. December 27, 2017

Linux Command Line Interface. December 27, 2017 Linux Command Line Interface December 27, 2017 Foreword It is supposed to be a refresher (?!) If you are familiar with UNIX/Linux/MacOS X CLI, this is going to be boring... I will not talk about editors

More information

Introduction to Linux

Introduction to Linux Introduction to Linux Prof. Jin-Soo Kim( jinsookim@skku.edu) TA - Dong-Yun Lee (dylee@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu What is Linux? A Unix-like operating

More information

Introduction to Linux

Introduction to Linux Introduction to Linux The command-line interface A command-line interface (CLI) is a type of interface, that is, a way to interact with a computer. Window systems, punched cards or a bunch of dials, buttons

More information

INSE Lab 1 Introduction to UNIX Fall 2017

INSE Lab 1 Introduction to UNIX Fall 2017 INSE 6130 - Lab 1 Introduction to UNIX Fall 2017 Updated by: Paria Shirani Overview In this lab session, students will learn the basics of UNIX /Linux commands. They will be able to perform the basic operations:

More information

Linux Shell Script. J. K. Mandal

Linux Shell Script. J. K. Mandal Linux Shell Script J. K. Mandal Professor, Department of Computer Science & Engineering, Faculty of Engineering, Technology & Management University of Kalyani Kalyani, Nadia, West Bengal E-mail: jkmandal@klyuniv.ac.in,

More information

Chapter Two. Lesson A. Objectives. Exploring the UNIX File System and File Security. Understanding Files and Directories

Chapter Two. Lesson A. Objectives. Exploring the UNIX File System and File Security. Understanding Files and Directories Chapter Two Exploring the UNIX File System and File Security Lesson A Understanding Files and Directories 2 Objectives Discuss and explain the UNIX file system Define a UNIX file system partition Use the

More information

Introduction to Unix. University of Massachusetts Medical School. October, 2014

Introduction to Unix. University of Massachusetts Medical School. October, 2014 .. Introduction to Unix University of Massachusetts Medical School October, 2014 . DISCLAIMER For the sake of clarity, the concepts mentioned in these slides have been simplified significantly. Most of

More information

Introduction to Linux Workshop 1

Introduction to Linux Workshop 1 Introduction to Linux Workshop 1 The George Washington University SEAS Computing Facility Created by Jason Hurlburt, Hadi Mohammadi, Marco Suarez hurlburj@gwu.edu Logging In The lab computers will authenticate

More information

Hitchhiker s Guide to VLSI Design with Cadence & Synopsys

Hitchhiker s Guide to VLSI Design with Cadence & Synopsys Hitchhiker s Guide to VLSI Design with Cadence & Synopsys David Money Harris 17 January 2009 The VLSI design tools at Harvey Mudd College are hosted on a Linux server named chips. This document introduces

More information

A Brief Haskell and GHC Refresher

A Brief Haskell and GHC Refresher A Brief Haskell and GHC Refresher Henrik Nilsson and Neil Sculthorpe School of Computer Science University of Nottingham 24th September 2013 1 Introduction The purpose of this document is to give you quick

More information

UNIX Quick Reference

UNIX Quick Reference UNIX Quick Reference Charles Duan FAS Computer Services August 26, 2002 1 Command Reference Many of these commands have many more options than the ones displayed here. Most also take the option h or help,

More information

Unix Filesystem. January 26 th, 2004 Class Meeting 2

Unix Filesystem. January 26 th, 2004 Class Meeting 2 Unix Filesystem January 26 th, 2004 Class Meeting 2 * Notes adapted by Christian Allgood from previous work by other members of the CS faculty at Virginia Tech Unix Filesystem! The filesystem is your interface

More information

Getting Started with UNIX

Getting Started with UNIX Getting Started with UNIX What is UNIX? Boston University Information Services & Technology Course Number: 4000 Course Instructor: Kenny Burns Operating System Interface between a user and the computer

More information

THE HONG KONG POLYTECHNIC UNIVERSITY Department of Electronic and Information Engineering

THE HONG KONG POLYTECHNIC UNIVERSITY Department of Electronic and Information Engineering THE HONG KONG POLYTECHNIC UNIVERSITY Department of Electronic and Information Engineering ENG224 Information Technology Part I: Computers and the Internet Laboratory 2 Linux Shell Commands and vi Editor

More information

CpSc 1111 Lab 1 Introduction to Unix Systems, Editors, and C

CpSc 1111 Lab 1 Introduction to Unix Systems, Editors, and C CpSc 1111 Lab 1 Introduction to Unix Systems, Editors, and C Welcome! Welcome to your CpSc 111 lab! For each lab this semester, you will be provided a document like this to guide you. This material, as

More information

CSC209. Software Tools and Systems Programming. https://mcs.utm.utoronto.ca/~209

CSC209. Software Tools and Systems Programming. https://mcs.utm.utoronto.ca/~209 CSC209 Software Tools and Systems Programming https://mcs.utm.utoronto.ca/~209 What is this Course About? Software Tools Using them Building them Systems Programming Quirks of C The file system System

More information

CHE3935. Lecture 1. Introduction to Linux

CHE3935. Lecture 1. Introduction to Linux CHE3935 Lecture 1 Introduction to Linux 1 Logging In PuTTY is a free telnet/ssh client that can be run without installing it within Windows. It will only give you a terminal interface, but used with a

More information

Lab 2: Linux/Unix shell

Lab 2: Linux/Unix shell Lab 2: Linux/Unix shell Comp Sci 1585 Data Structures Lab: Tools for Computer Scientists Outline 1 2 3 4 5 6 7 What is a shell? What is a shell? login is a program that logs users in to a computer. When

More information

CSCI 2132 Software Development. Lecture 3: Unix Shells and Other Basic Concepts

CSCI 2132 Software Development. Lecture 3: Unix Shells and Other Basic Concepts CSCI 2132 Software Development Lecture 3: Unix Shells and Other Basic Concepts Instructor: Vlado Keselj Faculty of Computer Science Dalhousie University 10-Sep-2018 (3) CSCI 2132 1 Introduction to UNIX

More information

AMS 200: Working on Linux/Unix Machines

AMS 200: Working on Linux/Unix Machines AMS 200, Oct 20, 2014 AMS 200: Working on Linux/Unix Machines Profs. Nic Brummell (brummell@soe.ucsc.edu) & Dongwook Lee (dlee79@ucsc.edu) Department of Applied Mathematics and Statistics University of

More information

Getting your department account

Getting your department account 02/11/2013 11:35 AM Getting your department account The instructions are at Creating a CS account 02/11/2013 11:36 AM Getting help Vijay Adusumalli will be in the CS majors lab in the basement of the Love

More information

*nix Crash Course. Presented by: Virginia Tech Linux / Unix Users Group VTLUUG

*nix Crash Course. Presented by: Virginia Tech Linux / Unix Users Group VTLUUG *nix Crash Course Presented by: Virginia Tech Linux / Unix Users Group VTLUUG Ubuntu LiveCD No information on your hard-drive will be modified. Gives you a working Linux system without having to install

More information

Lab 1 Introduction to UNIX and C

Lab 1 Introduction to UNIX and C Name: Lab 1 Introduction to UNIX and C This first lab is meant to be an introduction to computer environments we will be using this term. You must have a Pitt username to complete this lab. The doc is

More information

CMPUT 201: Practical Programming Methodology. Guohui Lin Department of Computing Science University of Alberta September 2018

CMPUT 201: Practical Programming Methodology. Guohui Lin Department of Computing Science University of Alberta September 2018 CMPUT 201: Practical Programming Methodology Guohui Lin guohui@ualberta.ca Department of Computing Science University of Alberta September 2018 Lecture 1: Course Outline Agenda: Course calendar description

More information

Introduction to Linux

Introduction to Linux Introduction to Linux Prof. Jin-Soo Kim( jinsookim@skku.edu) TA - Kisik Jeong (kisik@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu What is Linux? A Unix-like operating

More information

Introduction to the basics of UNIX

Introduction to the basics of UNIX Introduction to the basics of UNIX Joachim Hein Centre for Mathematical Sciences Lund University Outline 1 Operating system UNIX 2 Interacting with UNIX Manipulating files and directories Editing files:

More information

5/20/2007. Touring Essential Programs

5/20/2007. Touring Essential Programs Touring Essential Programs Employing fundamental utilities. Managing input and output. Using special characters in the command-line. Managing user environment. Surveying elements of a functioning system.

More information

Introduction to remote command line Linux. Research Computing Team University of Birmingham

Introduction to remote command line Linux. Research Computing Team University of Birmingham Introduction to remote command line Linux Research Computing Team University of Birmingham Linux/UNIX/BSD/OSX/what? v All different v UNIX is the oldest, mostly now commercial only in large environments

More information

Unix File System. Class Meeting 2. * Notes adapted by Joy Mukherjee from previous work by other members of the CS faculty at Virginia Tech

Unix File System. Class Meeting 2. * Notes adapted by Joy Mukherjee from previous work by other members of the CS faculty at Virginia Tech Unix File System Class Meeting 2 * Notes adapted by Joy Mukherjee from previous work by other members of the CS faculty at Virginia Tech Unix File System The file system is your interface to: physical

More information

Unix Handouts. Shantanu N Kulkarni

Unix Handouts. Shantanu N Kulkarni Unix Handouts Shantanu N Kulkarni Abstract These handouts are meant to be used as a study aid during my class. They are neither complete nor sincerely accurate. The idea is that the participants should

More information

ACS Unix (Winter Term, ) Page 92

ACS Unix (Winter Term, ) Page 92 ACS-294-001 Unix (Winter Term, 2016-2017) Page 92 The Idea of a Link When Unix creates a file, it does two things: 1. Set space on a disk to store data in the file. 2. Create a structure called an inode

More information

Introduction to Linux

Introduction to Linux Introduction to Linux January 2011 Don Bahls User Consultant (Group Leader) bahls@arsc.edu (907) 450-8674 Overview The shell Common Commands File System Organization Permissions Environment Variables I/O

More information

CS4023 Week04 Lab Exercise

CS4023 Week04 Lab Exercise CS4023 Week04 Lab Exercise Lab Objective: We will use this lab to log in to our Linux accounts and to look at some simple programs that perform a few elementary system calls. By the end of the lab we will

More information

CS246 Spring14 Programming Paradigm Notes on Linux

CS246 Spring14 Programming Paradigm Notes on Linux 1 Unix History 1965: Researchers from Bell Labs and other organizations begin work on Multics, a state-of-the-art interactive, multi-user operating system. 1969: Bell Labs researchers, losing hope for

More information

Oxford University Computing Services. Getting Started with Unix

Oxford University Computing Services. Getting Started with Unix Oxford University Computing Services Getting Started with Unix Unix c3.1/2 Typographical Conventions Listed below are the typographical conventions used in this guide. Names of keys on the keyboard are

More information

Introduction to the Linux Command Line

Introduction to the Linux Command Line Introduction to the Linux Command Line May, 2015 How to Connect (securely) ssh sftp scp Basic Unix or Linux Commands Files & directories Environment variables Not necessarily in this order.? Getting Connected

More information

COMP s1 Lecture 1

COMP s1 Lecture 1 COMP1511 18s1 Lecture 1 1 Numbers In, Numbers Out Andrew Bennett more printf variables scanf 2 Before we begin introduce yourself to the person sitting next to you why did

More information

Unix File System. Learning command-line navigation of the file system is essential for efficient system usage

Unix File System. Learning command-line navigation of the file system is essential for efficient system usage ULI101 Week 02 Week Overview Unix file system File types and file naming Basic file system commands: pwd,cd,ls,mkdir,rmdir,mv,cp,rm man pages Text editing Common file utilities: cat,more,less,touch,file,find

More information

Introduction to UNIX. Logging in. Basic System Architecture 10/7/10. most systems have graphical login on Linux machines

Introduction to UNIX. Logging in. Basic System Architecture 10/7/10. most systems have graphical login on Linux machines Introduction to UNIX Logging in Basic system architecture Getting help Intro to shell (tcsh) Basic UNIX File Maintenance Intro to emacs I/O Redirection Shell scripts Logging in most systems have graphical

More information

Operating Systems. Copyleft 2005, Binnur Kurt

Operating Systems. Copyleft 2005, Binnur Kurt 3 Operating Systems Copyleft 2005, Binnur Kurt Content The concept of an operating system. The internal architecture of an operating system. The architecture of the Linux operating system in more detail.

More information

UNIX Tutorial Five

UNIX Tutorial Five UNIX Tutorial Five 5.1 File system security (access rights) In your unixstuff directory, type % ls -l (l for long listing!) You will see that you now get lots of details about the contents of your directory,

More information

CS4350 Unix Programming. Outline

CS4350 Unix Programming. Outline Outline Unix Management Files and file systems Structure of Unix Commands Command help (man) Log on (terminal vs. graphical) System information (utility) File and directory structure (path) Permission

More information

Introduction to Linux

Introduction to Linux Introduction to Linux Prof. Jin-Soo Kim( jinsookim@skku.edu) TA Sanghoon Han(sanghoon.han@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Announcement (1) Please come

More information

Operating Systems 3. Operating Systems. Content. What is an Operating System? What is an Operating System? Resource Abstraction and Sharing

Operating Systems 3. Operating Systems. Content. What is an Operating System? What is an Operating System? Resource Abstraction and Sharing Content 3 Operating Systems The concept of an operating system. The internal architecture of an operating system. The architecture of the Linux operating system in more detail. How to log into (and out

More information

Practical Session 0 Introduction to Linux

Practical Session 0 Introduction to Linux School of Computer Science and Software Engineering Clayton Campus, Monash University CSE2303 and CSE2304 Semester I, 2001 Practical Session 0 Introduction to Linux Novell accounts. Every Monash student

More information

Introduction of Linux

Introduction of Linux Introduction of Linux 阳 oslab2018_class1@163.com 寅 oslab2018_class2@163.com PART I Brief Introduction Basic Conceptions & Environment Install & Configure a Virtual Machine Basic Commands PART II Shell

More information

Linux Operating System Environment Computadors Grau en Ciència i Enginyeria de Dades Q2

Linux Operating System Environment Computadors Grau en Ciència i Enginyeria de Dades Q2 Linux Operating System Environment Computadors Grau en Ciència i Enginyeria de Dades 2017-2018 Q2 Facultat d Informàtica de Barcelona This first lab session is focused on getting experience in working

More information

Introduction to UNIX Shell Exercises

Introduction to UNIX Shell Exercises Introduction to UNIX Shell Exercises Determining Your Shell Open a new window or use an existing window for this exercise. Observe your shell prompt - is it a $ or %? What does this tell you? Find out

More information

File system Security (Access Rights)

File system Security (Access Rights) File system Security (Access Rights) In your home directory, type % ls -l (l for long listing!) You will see that you now get lots of details about the contents of your directory, similar to the example

More information

STA 303 / 1002 Using SAS on CQUEST

STA 303 / 1002 Using SAS on CQUEST STA 303 / 1002 Using SAS on CQUEST A review of the nuts and bolts A.L. Gibbs January 2012 Some Basics of CQUEST If you don t already have a CQUEST account, go to www.cquest.utoronto.ca and request one.

More information

Exploring UNIX: Session 3

Exploring UNIX: Session 3 Exploring UNIX: Session 3 UNIX file system permissions UNIX is a multi user operating system. This means several users can be logged in simultaneously. For obvious reasons UNIX makes sure users cannot

More information

Lab 1 Introduction to UNIX and C

Lab 1 Introduction to UNIX and C Name: Lab 1 Introduction to UNIX and C This first lab is meant to be an introduction to computer environments we will be using this term. You must have a Pitt username to complete this lab. NOTE: Text

More information

EECS 2031E. Software Tools Prof. Mokhtar Aboelaze

EECS 2031E. Software Tools Prof. Mokhtar Aboelaze EECS 2031 Software Tools Prof. Mokhtar Aboelaze Footer Text 1 EECS 2031E Instructor: Mokhtar Aboelaze Room 2026 CSEB lastname@cse.yorku.ca x40607 Office hours TTH 12:00-3:00 or by appointment 1 Grading

More information

CSC209. Software Tools and Systems Programming. https://mcs.utm.utoronto.ca/~209

CSC209. Software Tools and Systems Programming. https://mcs.utm.utoronto.ca/~209 CSC209 Software Tools and Systems Programming https://mcs.utm.utoronto.ca/~209 What is this Course About? Software Tools Using them Building them Systems Programming Quirks of C The file system System

More information

Week Overview. Unix file system File types and file naming Basic file system commands: pwd,cd,ls,mkdir,rmdir,mv,cp,rm man pages

Week Overview. Unix file system File types and file naming Basic file system commands: pwd,cd,ls,mkdir,rmdir,mv,cp,rm man pages ULI101 Week 02 Week Overview Unix file system File types and file naming Basic file system commands: pwd,cd,ls,mkdir,rmdir,mv,cp,rm man pages Text editing Common file utilities: cat,more,less,touch,file,find

More information

Introduction p. 1 Who Should Read This Book? p. 1 What You Need to Know Before Reading This Book p. 2 How This Book Is Organized p.

Introduction p. 1 Who Should Read This Book? p. 1 What You Need to Know Before Reading This Book p. 2 How This Book Is Organized p. Introduction p. 1 Who Should Read This Book? p. 1 What You Need to Know Before Reading This Book p. 2 How This Book Is Organized p. 2 Conventions Used in This Book p. 2 Introduction to UNIX p. 5 An Overview

More information

Outline. Structure of a UNIX command

Outline. Structure of a UNIX command Outline Structure of Unix Commands Command help (man) Log on (terminal vs. graphical) System information (utility) File and directory structure (path) Permission (owner, group, rwx) File and directory

More information

CSE 391 Lecture 3. bash shell continued: processes; multi-user systems; remote login; editors

CSE 391 Lecture 3. bash shell continued: processes; multi-user systems; remote login; editors CSE 391 Lecture 3 bash shell continued: processes; multi-user systems; remote login; editors slides created by Marty Stepp, modified by Jessica Miller and Ruth Anderson http://www.cs.washington.edu/391/

More information

CS 2400 Laboratory Assignment #1: Exercises in Compilation and the UNIX Programming Environment (100 pts.)

CS 2400 Laboratory Assignment #1: Exercises in Compilation and the UNIX Programming Environment (100 pts.) 1 Introduction 1 CS 2400 Laboratory Assignment #1: Exercises in Compilation and the UNIX Programming Environment (100 pts.) This laboratory is intended to give you some brief experience using the editing/compiling/file

More information

Unix basics exercise MBV-INFX410

Unix basics exercise MBV-INFX410 Unix basics exercise MBV-INFX410 In order to start this exercise, you need to be logged in on a UNIX computer with a terminal window open on your computer. It is best if you are logged in on freebee.abel.uio.no.

More information

Introduction to Linux

Introduction to Linux Introduction to Linux Phil Mercurio The Scripps Research Institute mercurio@scripps.edu 1 Session Overview What is Linux Shells & Windows The Linux File System Assorted Commands 2 What Is Linux? Linux

More information

Linux Training. for New Users of Cluster. Georgia Advanced Computing Resource Center University of Georgia Suchitra Pakala

Linux Training. for New Users of Cluster. Georgia Advanced Computing Resource Center University of Georgia Suchitra Pakala Linux Training for New Users of Cluster Georgia Advanced Computing Resource Center University of Georgia Suchitra Pakala pakala@uga.edu 1 Overview GACRC Linux Operating System Shell, Filesystem, and Common

More information