CSE 391 Lecture 1. introduction to Linux/Unix environment

Similar documents
CSE 391 Lecture 1. introduction to Linux/Unix environment

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

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

Intro to Linux & Command Line

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

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

Introduction: What is Unix?

Introduction to Linux

CISC 220 fall 2011, set 1: Linux basics

Introduction to Linux

Mills HPC Tutorial Series. Linux Basics I

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

Perl and R Scripting for Biologists

Short Read Sequencing Analysis Workshop

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

CS 300. Data Structures

CSE 390a Lecture 3. Multi-user systems; remote login; editors; users/groups; permissions

Week 2 Lecture 3. Unix

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

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

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

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

Introduction to Linux. Fundamentals of Computer Science

Brief Linux Presentation. July 10th, 2006 Elan Borenstein

Getting Started With UNIX Lab Exercises

CSCI 2132 Software Development. Lecture 4: Files and Directories

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

C++ Programming on Linux

CSE 390a Lecture 5. Intro to shell scripting

CSE 391 Editing and Moving Files

CSE 391 Lecture 5. Intro to shell scripting

Helpful Tips for Labs. CS140, Spring 2015

CSE 390a Lecture 2. Exploring Shell Commands, Streams, and Redirection

Introduction to Linux

Introduction to Linux

Introduction to Linux Spring 2014, Section 02, Lecture 3 Jason Tang

Working with Basic Linux. Daniel Balagué

Introduction of Linux

Introduction in Unix. Linus Torvalds Ken Thompson & Dennis Ritchie

Operating Systems. Copyleft 2005, Binnur Kurt

AMS 200: Working on Linux/Unix Machines

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

GNU/Linux Course Lesson 1. Puria Nafisi

Introduction to Unix The Windows User perspective. Wes Frisby Kyle Horne Todd Johansen

The UNIX Operating System. HORT Lecture 2 Instructor: Kranthi Varala

Linux File System and Basic Commands

CS246 Spring14 Programming Paradigm Notes on Linux

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

CSE 390a Lecture 4. Persistent shell settings; users/groups; permissions

Using LINUX a BCMB/CHEM 8190 Tutorial Updated (1/17/12)

Introduction to Linux Basics

CSE 390a Lecture 2. Exploring Shell Commands, Streams, Redirection, and Processes

Command-line interpreters

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

Operating systems fundamentals - B02

CS Fundamentals of Programming II Fall Very Basic UNIX

Introduction to the Linux Command Line

Intermediate Programming, Spring Misha Kazhdan

EECS 470 Lab 5. Linux Shell Scripting. Friday, 1 st February, 2018

Lab 2: Linux/Unix shell

COSC UNIX. Textbook. Grading Scheme

Lecture # 2 Introduction to UNIX (Part 2)

CSE 390a Lecture 4. Persistent shell settings; users/groups; permissions

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

When talking about how to launch commands and other things that is to be typed into the terminal, the following syntax is used:

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

Processes. Shell Commands. a Command Line Interface accepts typed (textual) inputs and provides textual outputs. Synonyms:

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

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

Unit 10. Linux Operating System

Unix Tutorial Haverford Astronomy 2014/2015

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

EKT332 COMPUTER NETWORK

Using the Unix system. UNIX Introduction

Introduction to Unix: Fundamental Commands

Introduction to Linux Environment. Yun-Wen Chen

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

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

Basic UNIX commands. HORT Lab 2 Instructor: Kranthi Varala

Session 1: Accessing MUGrid and Command Line Basics

CENG 334 Computer Networks. Laboratory I Linux Tutorial

Using the Zoo Workstations

CS 300 Data Structures

Outline. Structure of a UNIX command

Computer Architecture Lab 1 (Starting with Linux)

Introduction. Let s start with the first set of slides

Using UNIX. -rwxr--r-- 1 root sys Sep 5 14:15 good_program

Introduction to UNIX. SURF Research Boot Camp April Jeroen Engelberts Consultant Supercomputing

Chapter-3. Introduction to Unix: Fundamental Commands

Linux hep.wisc.edu

Lecture 01 - Working with Linux Servers and Git

Linux Shell Script. J. K. Mandal

The Command Line. Matthew Bender. September 10, CMSC Command Line Workshop. Matthew Bender (2015) The Command Line September 10, / 25

CENG393 Computer Networks Labwork 1

Week 2. Exp 2 (a) (b): Introduction to LINUX OS, Installation of LINUX OS, Basic DOS commands

Introduction to Unix - Lab Exercise 0

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

CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX

Linux Command Line Primer. By: Scott Marshall

Scripting Languages Course 1. Diana Trandabăț

Transcription:

CSE 391 Lecture 1 introduction to Linux/Unix environment slides created by Marty Stepp, modified by Jessica Miller & Ruth Anderson http://www.cs.washington.edu/391/ 1

2 Lecture summary Course introduction and syllabus Unix and Linux operating system Introduction to Bash shell

Course Staff Me: Ruth Anderson, rea@cs Office hours in CSE 460: Mon 1:30-2:30pm, Tues 11-11:50am, and by appointment 3

Course Introduction CSE391 Collection of tools and topics not specifically addressed in other courses that CSE majors should know CSE 351 may be the first course you take that uses Linux Course Topics: Linix command line interface (CLI), Shell scripting, compilation tools (makefiles), version control Credit / No Credit course, determined by short weekly assignments 4

5 Operating systems What is an OS? Why have one? What is a Kernel?

Operating systems operating system: Manages activities and resources of a computer. software that acts as an interface between hardware and user provides a layer of abstraction for application developers features provided by an operating system: ability to execute programs (and multi-tasking) memory management (and virtual memory) file systems, disk and network access an interface to communicate with hardware a user interface (often graphical) kernel: The lowest-level core of an operating system. 6

Unix brief history: Multics (1964) for mainframes Unix (1969) K&R Linus Torvalds and Linux (1992) key Unix ideas: written in a high-level language (C) virtual memory hierarchical file system; "everything" is a file lots of small programs that work together to solve larger problems security, users, access, and groups human-readable documentation included 7

Linux Linux: A kernel for a Unix-like operating system. commonly seen/used today in servers, mobile/embedded devices,... GNU: A "free software" implementation of many Unix-like tools many GNU tools are distributed with the Linux kernel distribution: A pre-packaged set of Linux software. examples: Ubuntu, Fedora key features of Linux: open source software: source can be downloaded free to use constantly being improved/updated by the community 8

Linux Desktop X-windows window managers desktop environments Gnome KDE How can I try out Linux? CSE Virtual machine CSE basement labs attu shared server 9

10 Things you can do in Linux Load the course web site in a browser Install and play games Play MP3s Edit photos IM, Skype

Shell shell: An interactive program that uses user input to manage the execution of other programs. A command processor, typically runs in a text window. User types commands, the shell runs the commands Several different shell programs exist: bash : the default shell program on most Linux/Unix systems We will use bash Other shells: Bourne, csh, tsch Why should I learn to use a shell when GUIs exist? 11

Why use a shell? Why should I learn to use a shell when GUIs exist? faster work remotely programmable customizable repeatable 12

13 Shell commands command exit ls pwd cd man description logs out of the shell lists files in a directory print the current working directory changes the working directory brings up the manual for a command $ pwd /homes/iws/rea $ cd CSE391 $ ls file1.txt file2.txt $ ls l -rw-r--r-- 1 rea -rw-r--r-- 1 rea $ cd.. $ man ls $ exit fac_cs 0 2016-03-29 17:45 file1.txt fac_cs 0 2016-03-29 17:45 file2.txt

14 Relative directories directory description. the directory you are in ("working directory").. the parent of the working directory (../.. is grandparent, etc.) ~ your home directory (on many systems, this is /home/username ) ~username ~/Desktop username's home directory your desktop

Directory commands command description ls pwd cd mkdir rmdir list files in a directory print the current working directory changes the working directory create a new directory delete a directory (must be empty) some commands (cd, exit) are part of the shell ("builtins") others (ls, mkdir) are separate programs the shell runs 15

16 Shell commands many accept arguments or parameters example: cp (copy) accepts a source and destination file path a program uses 3 streams of information: stdin, stdout, stderr (standard in, out, error) input: comes from user's keyboard output: goes to console errors can also be printed (by default, sent to console like output) parameters vs. input parameters: input: before Enter is pressed; sent in by shell after Enter is pressed; sent in by user

Command-line arguments most options are a - followed by a letter such as -c some are longer words preceded by two - signs, such as --count options can be combined: ls -l -a -r can be ls -lar many programs accept a --help or -help option to give more information about that command (in addition to man pages) or if you run the program with no arguments, it may print help info for many commands that accept a file name argument, if you omit the parameter, it will read from standard input (your keyboard) 17

18 Shell/system commands command man or info clear exit command date cal uname description get help on a command clears out the output from the console exits and logs out of the shell description output the system date output a text calendar print information about the current system "man pages" are a very important way to learn new commands man ls man man

File commands command cp mv rm touch copy a file move or rename a file delete a file description create a new empty file, or update its last-modified time stamp caution: the above commands do not prompt for confirmation easy to overwrite/delete a file; this setting can be overridden (how?) Exercise : Given several albums of.mp3 files all in one folder, move them into separate folders by artist. Exercise : Modify a.java file to make it seem as though you finished writing it on Dec 28 at 4:56am. 19

Exercise Solutions caution: the cp, rm, mv commands do not prompt for confirmation easy to overwrite/delete a file; this setting can be overridden (how?) Use -i with the command, interactive to prompt before overwrite Exercise : Given several albums of.mp3 files all in one folder, move them into separate folders by artist. mkdir U2 mkdir PSY mkdir JustinBieber mv GangnamStyle.mp3 PSY/ mv Pride.mp3 U2/ Exercise : Modify a.java file to make it seem as though you finished writing it on Dec 28 at 4:56am. touch t 201612280456 Hello.java 20

Basic Emacs Commands C- = control key M- = meta/alt key read a file into Emacs: C-x C-f save a file back to disk: C-x C-s exit Emacs permanently: C-x C-c search forward: C-s search backward: C-r scroll to next screen: C-v scroll to previous screen: M-v Undo: C-x u entity to move over backward forward character C-b C-f word M-b M-f line C-p C-n go to line beginning/end C-a C-e go to buffer beginning/end M-< M-> https://courses.cs.washington.edu/courses/cse391/17au/handouts/emacs.pdf 21

Basic Vim Commands :w Write the current file :wq Write the current file and exit. :q! Quit without writing To change into insert mode: i or a Use escape to exit search forward /, repeat the search backwards: N Basic movement: h l k j character left, right; line up, down (also arrow keys) b w word/token left, right ge e end of word/token left, right 0 $ jump to first/last character on the line x delete u undo https://wiki.gentoo.org/wiki/vim/guide and http://tnerual.eriogerg.free.fr/vimqrc.pdf 22