Introduction to Linux

Similar documents
Introduction to Linux

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

Introduction to Linux

EE516: Embedded Software Project 1. Setting Up Environment for Projects

Introduction of Linux

Perl and R Scripting for Biologists

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

Overview LEARN. History of Linux Linux Architecture Linux File System Linux Access Linux Commands File Permission Editors Conclusion and Questions

Operating Systems. Copyleft 2005, Binnur Kurt

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

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

Introduction to Supercomputing

Unix Filesystem. January 26 th, 2004 Class Meeting 2

Unix System Architecture, File System, and Shell Commands

INF322 Operating Systems

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

UNIX. The Very 10 Short Howto for beginners. Soon-Hyung Yook. March 27, Soon-Hyung Yook UNIX March 27, / 29

Table of contents. Our goal. Notes. Notes. Notes. Summer June 29, Our goal is to see how we can use Unix as a tool for developing programs

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

Linux Systems Administration Getting Started with Linux

Essential Unix and Linux! Perl for Bioinformatics, ! F. Pineda

CENG393 Computer Networks Labwork 1

CSE 390a Lecture 1. introduction to Linux/Unix environment

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

CENG 334 Computer Networks. Laboratory I Linux Tutorial

GNU/Linux Course Lesson 1. Puria Nafisi

CSE 391 Lecture 1. introduction to Linux/Unix environment

Hands-on Keyboard: Cyber Experiments for Strategists and Policy Makers

Parallel Programming Pre-Assignment. Setting up the Software Environment

Chapter-3. Introduction to Unix: Fundamental Commands

CSE Linux VM. For Microsoft Windows. Based on opensuse Leap 42.2

Linux Essentials Objectives Topics:

Introduction to Unix: Fundamental Commands

CSE 391 Lecture 1. introduction to Linux/Unix environment

Introduction to Linux (Part I) BUPT/QMUL 2018/03/14

CSE 303 Lecture 2. Introduction to bash shell. read Linux Pocket Guide pp , 58-59, 60, 65-70, 71-72, 77-80

5/8/2012. Creating and Changing Directories Chapter 7

CISC 220 fall 2011, set 1: Linux basics

Introduction to Linux. Fundamentals of Computer Science

CS246 Spring14 Programming Paradigm Notes on Linux

The Unix Shell & Shell Scripts

Introduction: What is Unix?

INTRODUCTION TO LINUX

Session 1: Accessing MUGrid and Command Line Basics

Linux Essentials. Smith, Roderick W. Table of Contents ISBN-13: Introduction xvii. Chapter 1 Selecting an Operating System 1

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

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

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

Computer Systems and Architecture

Linux for Beginners. Windows users should download putty or bitvise:

commandname flags arguments

Beyond this course. Machine code. Readings: CP:AMA 2.1, 15.4

CMSC 104 Lecture 2 by S Lupoli adapted by C Grasso

Linux Shell Script. J. K. Mandal

Lec 1 add-on: Linux Intro

Contents. Note: pay attention to where you are. Note: Plaintext version. Note: pay attention to where you are... 1 Note: Plaintext version...

Introduction. Let s start with the first set of slides

Welcome to getting started with Ubuntu Server. This System Administrator Manual. guide to be simple to follow, with step by step instructions

Brief Linux Presentation. July 10th, 2006 Elan Borenstein

Linux at the Command Line Don Johnson of BU IS&T

Exercise 1: Basic Tools

CS 300. Data Structures

Overview of Unix / Linux operating systems

Intro to Linux & Command Line

Computer Systems and Architecture

UNIX COMMANDS AND SHELLS. UNIX Programming 2015 Fall by Euiseong Seo

A Brief Introduction to Unix

Introduction to Linux Basics

Unix/Linux Operating System. Introduction to Computational Statistics STAT 598G, Fall 2011

Introduction of Linux. Huang Cheng-Chao Dept. of Comput. Sci. & Tech. East China Normal University

Introduction to Linux

Practical Session 0 Introduction to Linux

Lecture 1. A. Sahu and S. V. Rao. Indian Institute of Technology Guwahati

Chap2: Operating-System Structures

Linux & Shell Programming 2014

Introduction to Cygwin Operating Environment

Lecture 3. Unix. Question? b. The world s best restaurant. c. Being in the top three happiest countries in the world.

Linux Essentials. Programming and Data Structures Lab M Tech CS First Year, First Semester

Welcome to Linux. Lecture 1.1

History. Terminology. Opening a Terminal. Introduction to the Unix command line GNOME

Introduction to Linux

Introduction To Linux. Rob Thomas - ACRC

Introduction to Linux

Virtual Machine. Linux flavor : Debian. Everything (except slides) preinstalled for you.

Introduction to UNIX command-line

Computer Architecture Lab 1 (Starting with Linux)

Lecture P3: Unix. Overview. Operating Systems. Layers of Abstractions in Unix. Background

CS197U: A Hands on Introduction to Unix

Unix Handouts. Shantanu N Kulkarni

Modern C++ for Computer Vision and Image Processing. Igor Bogoslavskyi and Cyrill Stachniss

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

1. What statistic did the wc -l command show? (do man wc to get the answer) A. The number of bytes B. The number of lines C. The number of words

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

EKT332 COMPUTER NETWORK

Introduction to Unix. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Laboratory 1 Semester 1 11/12

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

Operating Systems and Using Linux. Topics What is an Operating System? Linux Overview Frequently Used Linux Commands

Operating Systems. Engr. Abdul-Rahman Mahmood MS, PMP, MCP, QMR(ISO9001:2000) alphapeeler.sf.net/pubkeys/pkey.htm

GNU/Linux 101. Casey McLaughlin. Research Computing Center Spring Workshop Series 2018

Transcription:

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 system of a computer What is an OS? A resource manager of a computer A layer of software interposed between application programs and the hardware What is Unix? A time-sharing, multi-task, multi-user OS (Perhaps) the most important OS in computer history 2

What is an OS? OS is a resource manager Sharing Protection Fairness Performance OS provides the program execution environment Hides the messy details which must be performed. Presents users with a virtual machine, easier to use. 3

Linux Open-source development began in 1991 First released by Linus Torvalds Linux kernel The core of Linux system Thousands of contributors Supervised by Linus and other maintainers Distribution A collection of software based around Linux kernel Red Hat, Fedora, Debian, Ubuntu, Android, 4

Layered View of a Computer System Application Programs Text editor Web browser Game User Interfaces Kernel Operating system (Kernel) Hardware CPU MEM Disk NIC 5

User Interfaces The space where we interact with machines Command-line interface (CLI) Command interpreter Difficult to learn Called as shell Graphical user interface (GUI) KDE, Gnome, Unity, Xfce, Touch user interface Smartphones, tablets 6

Shell (1) A shell allows three types of commands An executable file that contains object code produced by a compilation of source code An internal shell command (built-in command) An executable file that contains a sequence of shell command lines (a shell script) There are two families of shells One based on Bourne shell (sh) We will use Bourne again shell (bash) for the course The other based on C shell (csh) 7

Shell (2) Executing programs on a shell $ command [options] [arguments] [$ ls] and [$ ls al] show different results All commands, options, arguments are case-sensitive Shells execute commands by means of processes A process is an instance of a program in execution 8

File & File System (1) A Unix file is a sequence of bytes Collection of related information defined by its creator Unstructured sequence of bytes File system Consist of two distinct parts: A collection of files A directory structure It provides the mechanism for on-line storage and access to file contents 9

File & File System (2) Features of Unix file system A hierarchical structure It allows dynamic growth of files The ability to create and delete files The protection of the file data Unix treats the peripheral devices as files Everything is a file in Unix Documents, directories, hard-drives, network sockets, keyboards, printers are stream of bytes exposed through the file system namespace 10

File & File System (3) All I/O devices are represented as files: /dev/sdb1 (hard disk partition) /dev/tty2 (terminal) Even the kernel is represented as a file: /dev/kmem (kernel memory image) /proc (kernel data structures) 11

File System Structure (1) Hierarchical, tree-like structure Root Non-leaf nodes Directories Leaf nodes Directories Regular files or special device files 12

File System Structure (2) *http://www.linuxplanet.com/linuxplanet/tutorials/6666/1 13

File System Structure (3) Root directory ["/"] The top-most directory in a hierarchy Home directory ["~"] A special directory for a user It contain the user s files; including texts, musics, videos, or configuration files (Current) Working directory Each process has associated with it a directory The directory where a user currently located 14

File System Structure (4) /bin Contains certain fundamental utilities /dev Essential devices /etc Host-specific system-wide configuration files /tmp A place for temporary files /var A place for files that may change often 15

Path The general form of the name of a file or a directory Delimiting characters ["/"] Represent each directory in path expressed in string Absolute path (full path) A path points a location regardless of present working directory $ cat /home/wooyeong/textfile $ cat ~/textfile Relative path A path relative to the working directory of the user $ cat textfile [if cwd is "/home/wooyeong"] 16

File Permission Every files have a set of permissions Ownership User/owner The person who owns/created the file. Group Unix allows for the creation of groups Others Everyone else in the world that has access to that computer Permission for Access Read (4) Write (2) execute (1) 17

Exercise : Lab #1

Contents Basic commands Basic C coding Setting up Ubuntu in VM 19

Basic commands (1) man Display the manual page Display a manual of a program or a function $ man qsort $ man man (manual for manual page) 20

Basic commands (2) ls List files $ ls $ ls -al /etc $ ll ps List process $ ps $ ps -ef $ man ps 21

Basic commands (3) pwd Print working directory cd Change working directory $ cd.. $ cd /proc $ cd ~ 22

Basic commands (4) echo Display a line of text $ echo "Hello?" printf Print a formatted line of text $ printf "%s\n" Hello? cat Displaying files $ cat /etc/issue more / less 23

Basic commands (5) mkdir / rmdir Make / remove a directory $ mkdir swex1 mv Move or rename files $ mv swex1/ swex2/ cp Copy files rm Remove files 24

Basic commands (6) date Print or set the system date and time grep Searching files for a specified expression $ grep [expression] [files] $ grep root /etc/passwd 25

Basic commands (7) chmod Change the permissions on a file or directory u user + to add a permission r(4) read g group - to remove a permission w(2) write o other = to assign a permission explicitly x(1) execute (for files), access (for directories) $ chmod u=rw file1 $ chmod u+x,g+w,o-r file2 $ ls l swex2/ $ chmod 750 swex2/ $ ls l swex2/ 26

Basic commands (8) diff [file1] [file2] Reports line-by-line differences between file1 and file2 27

Development tools vi[m] A text editor for programmers $ vi [file_name] Create (if not exist) or open a file 'file_name http://csl.skku.edu/sse2033s16/resources $ vi hello.c gcc GNU compiler collection $ gcc o hello hello.c $./hello 28

hello.c #include <stdio.h> int main(void) { printf("hello, world\n"); return 0; } 29

Exercise Lab exercise #1: Make "swex2" directory on your home directory Create hello.c on the directory Compile it Run the program Remove "swex2" directory Lab exercise #2: With hello.c file, make shell script that run exercise #1 automatically. 30

Exercise Lab exercise #3: Warming up coding for next assignment. Make my_string.c file for string manipulation. Skeleton code is uploaded Assignments http://csl.skku.edu/sse2033s16/projects 31

Setting Up a Ubuntu VM

Steps 1. Install VirtualBox on your computer 2. Create a virtual machine (VM) 3. Install Ubuntu on the VM 4. Fun 33

Installing VirtualBox (1) Go to VirtualBox website https://www.virtualbox.org/wiki/downloads Download installation binary 34

Installing VirtualBox (2) 35

Installing VirtualBox (3) 36

Creating a VM (1) 37

Creating a VM (2) 38

Creating a VM (3) 39

Installing Ubuntu on the VM (1) Go to http://www.ubuntu.com/download/desktop or http://ftp.daum.net/ubuntu-releases/ Download a desktop image 40

Installing Ubuntu on the VM (2) 41

Installing Ubuntu on the VM (3) 42

Installing Ubuntu on the VM (4) 43

Installing Ubuntu on the VM (5) 44

Installing Ubuntu on the VM (6) 45

Installing Ubuntu on the VM (7) Press Ctrl + Alt + T to launch a terminal (shell) Type the following commands: $ sudo apt-get update $ sudo apt-get install build-essential 46