AOS Linux Tutorial. Introduction to Linux. Michael Havas Dept. of Atmospheric and Oceanic Sciences McGill University. September 15, 2011

Similar documents
Welcome. IT in AOS. Michael Havas Dept. of Atmospheric and Oceanic Sciences McGill University. September 21, 2012

Week 2 Lecture 3. Unix

Linux Essentials Objectives Topics:

Working with Basic Linux. Daniel Balagué

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

CS Unix Tools. Lecture 2 Fall Hussam Abu-Libdeh based on slides by David Slater. September 10, 2010

Unix Filesystem. January 26 th, 2004 Class Meeting 2

Essential Linux Shell Commands

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

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

Welcome to Linux. Lecture 1.1

Introduction to Linux

Files (review) and Regular Expressions. Todd Kelley CST8207 Todd Kelley 1

Working with Ubuntu. Bok, Jong Soon

Introduction to the Linux Command Line

Chapter-3. Introduction to Unix: Fundamental Commands

UNIX File Hierarchy: Structure and Commands

Linux Command Line Primer. By: Scott Marshall

Introduction to Unix: Fundamental Commands

Introduction to Linux Basics

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

Mills HPC Tutorial Series. Linux Basics I

Introduction to Linux

AN INTRODUCTION TO UNIX

Intro to Linux & Command Line

INTRODUCTION TO LINUX

CENG 334 Computer Networks. Laboratory I Linux Tutorial

Chapter 1 - Introduction. September 8, 2016

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

CISC 220 fall 2011, set 1: Linux basics

CS246 Spring14 Programming Paradigm Notes on Linux

Brief Linux Presentation. July 10th, 2006 Elan Borenstein

Perl and R Scripting for Biologists

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

Files

Introduction to Linux

A Brief Introduction to Unix

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

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

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

Filesystem and common commands

Unix background. COMP9021, Session 2, Using the Terminal application, open an x-term window. You type your commands in an x-term window.

Introduction: What is Unix?

Practical 4. Linux Commands: Working with Directories

Files and Directories

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

CS 307: UNIX PROGRAMMING ENVIRONMENT KATAS FOR EXAM 1

Carnegie Mellon. Linux Boot Camp. Jack, Matthew, Nishad, Stanley 6 Sep 2016

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

Introduction to Linux

Introduction to the UNIX command line

Introduction to Linux

Outline. Structure of a UNIX command

commandname flags arguments

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

12/7/10 ATSC 212 UNIX ATSC 212 ATSC 212 UNIX

Introduction to Linux Part I: The Filesystem Luca Heltai

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

Links, basic file manipulation, environmental variables, executing programs out of $PATH

Computer Architecture Lab 1 (Starting with Linux)

Lab 2: Linux/Unix shell

SECTION -C. Getting Started with UNIX

Introduc)on to Linux Session 2 Files/Filesystems/Data. Pete Ruprecht Research Compu)ng Group University of Colorado Boulder

Linux File System and Basic Commands

Computer Systems and Architecture

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

Introduction to Linux

Course 144 Supplementary Materials. UNIX Fundamentals

Practical Session 0 Introduction to Linux

Computer Systems and Architecture

Intro to Linux. this will open up a new terminal window for you is super convenient on the computers in the lab

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

COMS 6100 Class Notes 3

Getting started with Hugs on Linux

The UNIX File System

Unix Introduction to UNIX

Getting your department account

CSE 391 Lecture 1. introduction to Linux/Unix environment

Kurt Schmidt. October 12, 2018

Introduction to Linux

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

Getting started with Hugs on Linux

Introduction. Let s start with the first set of slides

Multiple Choice - 58 Questions - 10 of 15%

Crash Course in Unix. For more info check out the Unix man pages -orhttp:// -or- Unix in a Nutshell (an O Reilly book).

GNU/Linux Course Lesson 1. Puria Nafisi

Useful Unix Commands Cheat Sheet

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

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

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

INF322 Operating Systems

Introduction to Linux

Lab01: Part I. Introduction to Linux. Professional Training Academy Linux Series

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

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

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

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

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

CHAPTER 1 UNIX FOR NONPROGRAMMERS

Transcription:

AOS Linux Tutorial Introduction to Linux Michael Havas Dept. of Atmospheric and Oceanic Sciences McGill University September 15, 2011

Outline 1 Introduction to Linux Benefits of Linux What Exactly is Linux? The Free-Software Philosophy 2 The Graphical User Interface Cross-Platform Applications Windows Applications and Their Linux Counterparts 3 The Command-Line The Filesystem File and Directory Management Globbing Finding Files Ownership and Permissions 4 Fun Tips 5 Next Time

Why Linux? Free. Free. Scientific Software. Community. Security. Stability. Learn Linux, Learn *nix.

Why Linux? Free. Free. Scientific Software. Community. Security. Stability. Learn Linux, Learn *nix.

Why Linux? Free. Free. Scientific Software. Community. Security. Stability. Learn Linux, Learn *nix.

Why Linux? Free. Free. Scientific Software. Community. Security. Stability. Learn Linux, Learn *nix.

Why Linux? Free. Free. Scientific Software. Community. Security. Stability. Learn Linux, Learn *nix.

Why Linux? Free. Free. Scientific Software. Community. Security. Stability. Learn Linux, Learn *nix.

Why Linux? Free. Free. Scientific Software. Community. Security. Stability. Learn Linux, Learn *nix.

What is Linux? A Unix-like operating system created by Linus Torvalds in 1991. Uses the GNU set of tools developed by Richard Stallman. Free and Open source under the GPL license. Not just a product but a collection of products.

What is Linux? A Unix-like operating system created by Linus Torvalds in 1991. Uses the GNU set of tools developed by Richard Stallman. Free and Open source under the GPL license. Not just a product but a collection of products.

What is Linux? A Unix-like operating system created by Linus Torvalds in 1991. Uses the GNU set of tools developed by Richard Stallman. Free and Open source under the GPL license. Not just a product but a collection of products.

What is Linux? A Unix-like operating system created by Linus Torvalds in 1991. Uses the GNU set of tools developed by Richard Stallman. Free and Open source under the GPL license. Not just a product but a collection of products.

Why Free Software? When you use free software, you also get the freedom to study, copy, change and redistribute the source code. If you don t like something, change it!

Why Free Software? When you use free software, you also get the freedom to study, copy, change and redistribute the source code. If you don t like something, change it!

Outline 1 Introduction to Linux Benefits of Linux What Exactly is Linux? The Free-Software Philosophy 2 The Graphical User Interface Cross-Platform Applications Windows Applications and Their Linux Counterparts 3 The Command-Line The Filesystem File and Directory Management Globbing Finding Files Ownership and Permissions 4 Fun Tips 5 Next Time

Cross-Platform Applications Firefox. Thunderbird. VLC. OpenOffice. Pidgin. FileZilla. Google Earth. Picasa. Adobe Reader. Adobe Flash. Opera. Skype. Google Chrome.

Cross-Platform Applications Firefox. Thunderbird. VLC. OpenOffice. Pidgin. FileZilla. Google Earth. Picasa. Adobe Reader. Adobe Flash. Opera. Skype. Google Chrome.

Cross-Platform Applications Firefox. Thunderbird. VLC. OpenOffice. Pidgin. FileZilla. Google Earth. Picasa. Adobe Reader. Adobe Flash. Opera. Skype. Google Chrome.

Cross-Platform Applications Firefox. Thunderbird. VLC. OpenOffice. Pidgin. FileZilla. Google Earth. Picasa. Adobe Reader. Adobe Flash. Opera. Skype. Google Chrome.

Cross-Platform Applications Firefox. Thunderbird. VLC. OpenOffice. Pidgin. FileZilla. Google Earth. Picasa. Adobe Reader. Adobe Flash. Opera. Skype. Google Chrome.

Cross-Platform Applications Firefox. Thunderbird. VLC. OpenOffice. Pidgin. FileZilla. Google Earth. Picasa. Adobe Reader. Adobe Flash. Opera. Skype. Google Chrome.

Cross-Platform Applications Firefox. Thunderbird. VLC. OpenOffice. Pidgin. FileZilla. Google Earth. Picasa. Adobe Reader. Adobe Flash. Opera. Skype. Google Chrome.

Cross-Platform Applications Firefox. Thunderbird. VLC. OpenOffice. Pidgin. FileZilla. Google Earth. Picasa. Adobe Reader. Adobe Flash. Opera. Skype. Google Chrome.

Cross-Platform Applications Firefox. Thunderbird. VLC. OpenOffice. Pidgin. FileZilla. Google Earth. Picasa. Adobe Reader. Adobe Flash. Opera. Skype. Google Chrome.

Cross-Platform Applications Firefox. Thunderbird. VLC. OpenOffice. Pidgin. FileZilla. Google Earth. Picasa. Adobe Reader. Adobe Flash. Opera. Skype. Google Chrome.

Cross-Platform Applications Firefox. Thunderbird. VLC. OpenOffice. Pidgin. FileZilla. Google Earth. Picasa. Adobe Reader. Adobe Flash. Opera. Skype. Google Chrome.

Cross-Platform Applications Firefox. Thunderbird. VLC. OpenOffice. Pidgin. FileZilla. Google Earth. Picasa. Adobe Reader. Adobe Flash. Opera. Skype. Google Chrome.

Cross-Platform Applications Firefox. Thunderbird. VLC. OpenOffice. Pidgin. FileZilla. Google Earth. Picasa. Adobe Reader. Adobe Flash. Opera. Skype. Google Chrome.

Applications in Windows and Linux Type Windows Linux Web Browser Internet Explorer Firefox Email Client Outlook Thunderbird File Transfer CuteFTP Filezilla Instant Messenger MSN Messenger Pidgin Media Player Windows Media Player VLC File Browser Windows Explorer Nautilus Raster Graphics Editor Photoshop The GIMP Vector Graphics Editor Illustrator Inkscape Office Suite Microsoft Office OpenOffice PDF Viewer Adobe Reader Evince Music Player Itunes Rhythmbox More equivalent applications http://www.linuxrsp.ru/win-lin-soft/table-eng.html

The Graphical User Interface

Outline 1 Introduction to Linux Benefits of Linux What Exactly is Linux? The Free-Software Philosophy 2 The Graphical User Interface Cross-Platform Applications Windows Applications and Their Linux Counterparts 3 The Command-Line The Filesystem File and Directory Management Globbing Finding Files Ownership and Permissions 4 Fun Tips 5 Next Time

Why use the Command-Line? Fast. Efficient. Powerful. Scripting language. Remote access. Almost Anything you can do in the GUI, you can do on the command line: Listen to music. Read email. Browse the web. Watch movies (kinda: towel.blinkenlights.nl).

The Filesystem One root to rule them all

The Filesystem Different devices, same root

Absolute vs Relative Paths Absolute vs Relative Absolute Starting from the root (/). Relative Starting from your working directory. Special Paths. The current directory... The parent of the current directory. On Linux, everything is case sensitive!

Absolute vs Relative Paths An Example

Getting Around Shortcuts Shortcuts ${HOME} Your home directory. Your home directory. mhavas My home directory.

Getting Around Commands ls List contents of directory. cd Change directory. pwd Print working/current directory. Tab-completion is your friend

File and Directory Management Commans touch file Creates a file called file. mkdir dir Creates a directory dir. rm file Remove a file. rmdir dir Remove an empty directory dir. cp src dst Copies file from src to dst. mv src dst Moves file/dir from src to dst. du file Prints size of file in bytes. file file Prints what type of file file is. ln file link Creates a hard or soft link between file and link.

File and Directory Management Useful Options Commands mkdir -p path Creates all directories if they do not exist in path. rm -r dir Removes all files and directories in dir including dir cp -a srcdir dstdir Copies directory and contents from srcdir to dstdir. ls -l Same as ls but gives more information. du -hs dir Prints size of directory and all contents in human-readable format. Getting Help For useful options and detailed help for almost any program, you can look at the manual for that specific command using: man command.

File and Directory Management Links Soft Links Command: ln -s file link Creates a named link between file and link. Hard Links Command: ln file link Creates a physical link between file and link. Deletion is handled differently

Globbing Allows you to select many items at once. * Match anything at any length.? Match one character. [ab] Match characters a or b. {blah,foo} Match words blah or foo. ˆglob Match anything but glob.

Globbing Examples [mhavas@lappy tmp]$ ls a.1 b.1 c.1 t2.sh test1.txt [mhavas@lappy tmp]$ ls t?.sh

Globbing Examples [mhavas@lappy tmp]$ ls a.1 b.1 c.1 t2.sh test1.txt [mhavas@lappy tmp]$ ls t?.sh t2.sh

Globbing Examples [mhavas@lappy tmp]$ ls a.1 b.1 c.1 t2.sh test1.txt [mhavas@lappy tmp]$ ls t?.sh t2.sh [mhavas@lappy tmp]$ ls [ab]*

Globbing Examples [mhavas@lappy tmp]$ ls a.1 b.1 c.1 t2.sh test1.txt [mhavas@lappy tmp]$ ls t?.sh t2.sh [mhavas@lappy tmp]$ ls [ab]* a.1 b.1

Globbing Examples [mhavas@lappy tmp]$ ls a.1 b.1 c.1 t2.sh test1.txt [mhavas@lappy tmp]$ ls t?.sh t2.sh [mhavas@lappy tmp]$ ls [ab]* a.1 b.1 [mhavas@lappy tmp]$ ls [a-c]*

Globbing Examples [mhavas@lappy tmp]$ ls a.1 b.1 c.1 t2.sh test1.txt [mhavas@lappy tmp]$ ls t?.sh t2.sh [mhavas@lappy tmp]$ ls [ab]* a.1 b.1 [mhavas@lappy tmp]$ ls [a-c]* a.1 b.1 c.1

Globbing Examples [mhavas@lappy tmp]$ ls a.1 b.1 c.1 t2.sh test1.txt [mhavas@lappy tmp]$ ls t?.sh t2.sh [mhavas@lappy tmp]$ ls [ab]* a.1 b.1 [mhavas@lappy tmp]$ ls [a-c]* a.1 b.1 c.1 [mhavas@lappy tmp]$ ls [^ab]*

Globbing Examples [mhavas@lappy tmp]$ ls a.1 b.1 c.1 t2.sh test1.txt [mhavas@lappy tmp]$ ls t?.sh t2.sh [mhavas@lappy tmp]$ ls [ab]* a.1 b.1 [mhavas@lappy tmp]$ ls [a-c]* a.1 b.1 c.1 [mhavas@lappy tmp]$ ls [^ab]* c.1 t2.sh test1.txt

Globbing Examples [mhavas@lappy tmp]$ ls a.1 b.1 c.1 t2.sh test1.txt [mhavas@lappy tmp]$ ls t?.sh t2.sh [mhavas@lappy tmp]$ ls [ab]* a.1 b.1 [mhavas@lappy tmp]$ ls [a-c]* a.1 b.1 c.1 [mhavas@lappy tmp]$ ls [^ab]* c.1 t2.sh test1.txt [mhavas@lappy tmp]$ ls {b*,c*,*est*}

Globbing Examples [mhavas@lappy tmp]$ ls a.1 b.1 c.1 t2.sh test1.txt [mhavas@lappy tmp]$ ls t?.sh t2.sh [mhavas@lappy tmp]$ ls [ab]* a.1 b.1 [mhavas@lappy tmp]$ ls [a-c]* a.1 b.1 c.1 [mhavas@lappy tmp]$ ls [^ab]* c.1 t2.sh test1.txt [mhavas@lappy tmp]$ ls {b*,c*,*est*} b.1 c.1 test1.txt

Finding Files Finding Files Find files using locate locate word Find file or directory that has word in it. Fast but only search a database. Database is refreshed once a day using updatedb Find files using find find path -iname *word* Finds files and directories recursively starting in path path that have word in their filename. Very useful command and has lots and lots of options.

Finding Files Useful arguments to find More on the find command find. -type d Find all directories under the current directory. find. -type f Find all files under the current directory. find. -mtime 1 Find that were created in the past 24 hours. find. -daystart -mtime +0 -mtime -3 Find files created between yesterday and the day before. find. -size -5k Find files less than 5 kilobytes. Operating on found files find. -type d -exec chmod 755 {} \; Find all directories under the current directory and execute chmod 755 on them. find. -type f -exec chmod 644 {} \; Find all files under the current directory and execute chmod 755 on them.

Finding Files Finding Programs The path environment variable path tells the shell where to look for files. You can execute a program in your path by typing program. Programs not in your path must include the program s path. For example, /aos/shared/bin/matlab You can see your path by issuing env $PATH Searching through your path which program Will show the location of the first program named program in your path. which -a program Will show all programs names program in your path. Note that only the first will run if you type program. whereis program Will search for a program s binary, source and help in their standard locations.

Ownership and Permissions Owner [mhavas@lappy tmp]$ ls -l -rw-rw-r--. 1 mhavas mhavas 0 2009-09-23 15:18 a.1 -rw-rw-r--. 1 mhavas mhavas 0 2009-09-23 15:18 b.1 -rw-rw-r--. 1 mhavas mhavas 0 2009-09-23 15:18 c.1 -rw-rw-r--. 1 mhavas mhavas 0 2009-09-23 15:18 t2.sh -rw-rw-r--. 1 mhavas mhavas 0 2009-09-23 15:18 test1.txt

Ownership and Permissions Group [mhavas@lappy tmp]$ ls -l -rw-rw-r--. 1 mhavas mhavas 0 2009-09-23 15:18 a.1 -rw-rw-r--. 1 mhavas mhavas 0 2009-09-23 15:18 b.1 -rw-rw-r--. 1 mhavas mhavas 0 2009-09-23 15:18 c.1 -rw-rw-r--. 1 mhavas mhavas 0 2009-09-23 15:18 t2.sh -rw-rw-r--. 1 mhavas mhavas 0 2009-09-23 15:18 test1.txt

Ownership and Permissions Changing Ownership Commands for changing ownership chown user file Change the ownership of file to user. chgrp group file Change the group ownership of file to group. chown user:group file Change the ownership of file to user user and group group. Both commands can take a -R argument to apply the change recursively.

Ownership and Permissions Permissions [mhavas@lappy tmp]$ ls -l -rw-rw-r--. 1 mhavas mhavas 0 2009-09-23 15:18 a.1 -rw-rw-r--. 1 mhavas mhavas 0 2009-09-23 15:18 b.1 -rw-rw-r--. 1 mhavas mhavas 0 2009-09-23 15:18 c.1 -rw-rw-r--. 1 mhavas mhavas 0 2009-09-23 15:18 t2.sh -rw-rw-r--. 1 mhavas mhavas 0 2009-09-23 15:18 test1.txt

Ownership and Permissions Permissions user group other r w x r w x r w x File Permissions r Read file. w Write file. x Execute file. Group Permissions r List contents. w Write into. x Enter.

Ownership and Permissions Changing Permissions Commands for changing permissions chmod perms file Changes the permission of file file to perms. perms? what perms? user group other r w x r w x r w x [mhavas@lappy tmp]$ ls -l a.1 -rw-r--r--. a.1 [mhavas@lappy tmp]$ chmod g+x,o+x a.1 [mhavas@lappy tmp]$ ls -l a.1

Ownership and Permissions Changing Permissions Commands for changing permissions chmod perms file Changes the permission of file file to perms. perms? what perms? user group other r w x r w x r w x [mhavas@lappy tmp]$ ls -l a.1 -rw-r--r--. a.1 [mhavas@lappy tmp]$ chmod g+x,o+x a.1 [mhavas@lappy tmp]$ ls -l a.1 -rw-r-xr-x. a.1

Ownership and Permissions Changing Permissions Commands for changing permissions chmod perms file Changes the permission of file file to perms. perms? what perms? user group other r w x r w x r w x [mhavas@lappy tmp]$ ls -l a.1 -rw-r--r--. a.1 [mhavas@lappy tmp]$ chmod g+x,o+x a.1 [mhavas@lappy tmp]$ ls -l a.1 -rw-r-xr-x. a.1 [mhavas@lappy tmp]$ chmod a+w a.1 [mhavas@lappy tmp]$ ls -l a.1

Ownership and Permissions Changing Permissions Commands for changing permissions chmod perms file Changes the permission of file file to perms. perms? what perms? user group other r w x r w x r w x [mhavas@lappy tmp]$ ls -l a.1 -rw-r--r--. a.1 [mhavas@lappy tmp]$ chmod g+x,o+x a.1 [mhavas@lappy tmp]$ ls -l a.1 -rw-r-xr-x. a.1 [mhavas@lappy tmp]$ chmod a+w a.1 [mhavas@lappy tmp]$ ls -l a.1 -rw-rwxrwx. a.1

Outline 1 Introduction to Linux Benefits of Linux What Exactly is Linux? The Free-Software Philosophy 2 The Graphical User Interface Cross-Platform Applications Windows Applications and Their Linux Counterparts 3 The Command-Line The Filesystem File and Directory Management Globbing Finding Files Ownership and Permissions 4 Fun Tips 5 Next Time

Fun Tips cd - Go back to the last directory you visited. cd Go to your home directory. mkdir -p dir/{dir1,dir2,dir3} Create multiple nested directories at once.

Outline 1 Introduction to Linux Benefits of Linux What Exactly is Linux? The Free-Software Philosophy 2 The Graphical User Interface Cross-Platform Applications Windows Applications and Their Linux Counterparts 3 The Command-Line The Filesystem File and Directory Management Globbing Finding Files Ownership and Permissions 4 Fun Tips 5 Next Time

Next Time Next Time More on the command-line. Shell scripting in bash. Gnuplot. Suggested topics.