Welcome to Linux & Shell Scripting Small Group How to learn how to Code Workshop small-group/

Slides:



Advertisements
Similar presentations
Client-server practices DSC340 Mike Pangburn. Agenda Overview of client-server development Editing on client (e.g., Notepad) or directly on server (e.g.,
Advertisements

Introduction to Linux command line for bioinformatics Wenjun Kang, MS Jorge Andrade, PhD 6/28/2013 Bioinformatics Core, Center.
Linux, it's not Windows A short introduction to the sub-department's computer systems Gareth Thomas.
Learning Unix/Linux Bioinformatics Orientation 2008 Eric Bishop.
Introduction to Linux Alan Orth April 17, 2010 ILRI, Nairobi.
Introducing the Command Line CMSC 121 Introduction to UNIX Much of the material in these slides was taken from Dan Hood’s CMSC 121 Lecture Notes.
CS1020: Intro Workshop. Topics CS1020Intro Workshop Login to UNIX operating system 2. …………………………………… 3. …………………………………… 4. …………………………………… 5. ……………………………………
Very Quick & Basic Unix Steven Newhouse Unix is user-friendly. It's just very selective about who its friends are.
Virtual Machine and UNIX. What is a VM? VM stands for Virtual Machine. It is a software emulation of hardware. By using a VM, you can have the same hardware.
Linux & Shell Scripting Small Group Lecture 4 How to Learn to Code Workshop group/ Erin.
“Linux at the Command Line” Don Johnson of BU IS&T.
1 SEEM3460 Tutorial Unix Introduction. 2 Introduction What is Unix? An operation system (OS), similar to Windows, MacOS X Why learn Unix? Greatest Software.
A crash course in njit’s Afs
L INUX C OMMAND L INE I NTERFACE G UNAANBAN.G
Using Macs and Unix Nancy Griffeth January 6, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis of Complex.
Introduction to Linux Workshop February Introduction Rob Lane & The HPC Support Team Research Computing Services CUIT.
MCB Lecture #3 Sept 2/14 Intro to UNIX terminal.
Powering up your graduate experience A survey of computational tools and approaches for biologists Erin Osborne.
Unix Tutorial for FreeSurfer Users Allison Stevens.
Overview of Linux CS3530 Spring 2014 Dr. José M. Garrido Department of Computer Science.
Essential Unix at ACEnet Joey Bernard, Computational Research Consultant.
HPC at HCC Jun Wang Outline of Workshop1 Overview of HPC Computing Resources at HCC How to obtain an account at HCC How to login a Linux cluster at HCC.
Computer Programming for Biologists Oct 30 th – Dec 11 th, 2014 Karsten Hokamp  Fill out.
Unix Tutorial for FreeSurfer Users. Helpful To Know FreeSurfer Tutorial Wiki:
Powering up your graduate experience A survey of computational tools and approaches for biologists Erin Osborne.
PROGRAMMING PROJECT POLICIES AND UNIX INTRO Sal LaMarca CSCI 1302, Fall 2009.
Unix Tutorial for FreeSurfer Users. Helpful To Know FreeSurfer Tutorial Wiki:
Session 2 Wharton Summer Tech Camp Basic Unix. Agenda Cover basic UNIX commands and useful functions.
Linux & Shell Scripting Small Group Lecture 3 How to Learn to Code Workshop group/ Erin.
CIT 140: Introduction to ITSlide #1 CSC 140: Introduction to IT Operating Systems.
Lesson 2-Touring Essential Programs. Overview Development of UNIX and Linux. Commands to execute utilities. Communicating instructions to the shell. Navigating.
BIF713 Basic Unix/Linux Commands Getting Help with Commands.
Unix and Samba By: IC Labs (Raj Kidambi). What is Unix?  Unix stands for UNiplexed Information and Computing System. (It was originally spelled "Unics.")
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: whereis, which, whoami, finger, passwd, cal, date Working with Files: cat, more, less.
CS 245 – Part 1 Using Operating Systems and Networks for Programmers Jiang Guo Dept. of Computer Science California State University Los Angeles.
AN INTRO TO UNIX/LINUX COMMANDS BY: JIAYANG WANG.
Linux A practical introduction. 1)Background and Getting Started Linux is an operating system with multiple providers Red Hat/CentOS (our version) Ubuntu.
 Last lesson, the Windows Operating System was discussed along with the Windows command shell  Unix is a computer operating system, that similarly manages.
1 CS3695 – Network Vulnerability Assessment & Risk Mitigation – Introduction to Unix & Linux.
+ Vieques and Your Computer Dan Malmer & Joey Azofeifa.
CS 120 Extra: The CS1 Server Tarik Booker CS 120.
Learning Unix/Linux Based on slides from: Eric Bishop.
Operating systems Lecture #3 Modern OS characteristics.
Introduction to LINUX command line Allegra Via IBBE, National Research Council, Italy Sapienza Università di Roma, Italy EMBO Practical Course on Computational.
INTRODUCTION TO SHELL SCRIPTING By Byamukama Frank
Assignprelim.1 Assignment Preliminaries © 2012 B. Wilkinson/Clayton Ferner. Modification date: Jan 16a, 2014.
Review Why do we use protection levels? Why do we use constructors?
UNIX Basics Matt Hayward October 18, 2016 LS560 – Information Technology for information professionals.
Linux & Joker – An Introduction
Tutorial Six Linux Basics CompSci Semester Two 2016.
Overview of Linux Fall 2016 Dr. Donghyun Kim
Introduction to Unix for FreeSurfer Users
GRID COMPUTING.
UNIX To do work for the class, you will be using the Unix operating system. Once connected to the system, you will be presented with a login screen. Once.
CS1010: Intro Workshop.
Development Environment Basics
Tutorial Six Recap & Linux Basics CompSci Semester Two 2016.
Web Programming Essentials:
Prepared by: Eng. Maryam Adel Abdel-Hady
Linux Commands Help HANDS ON TRAINING Author: Muhammad Laique
Andy Wang Object Oriented Programming in C++ COP 3330
Some Linux Commands.
Assignment Preliminaries
Lecture #3 Modern OS characteristics
Web Programming Essentials:
The Unix File System.
Andy Wang Object Oriented Programming in C++ COP 3330
UNIX/LINUX Commands Using BASH Copyright © 2017 – Curt Hill.
Lab 2: Terminal Basics.
DIBBs Brown Dog Tutorial Setup
Presentation transcript:

Welcome to Linux & Shell Scripting Small Group How to learn how to Code Workshop small-group/ Erin Osborne Nishimura 1

Pop quiz! 2

Why should biologists learn to code? Power Efficiency Reproducibility 3

What are the barriers to learn to code? Where to begin? This feels awkward Sporadic use Hitting a wall/bug Finding help Cultural barriers 4

Where to begin? computing environments and languages Linux – an open-source operating system. bash – A command-writing language. The “language” of linux. Good for tasks, automated workflows, and general management. Python – A general purpose, high-level programming language. Highly readable and writable. Perl – A general purpose, high-level programming language. Great with text files. Javascript – a general purpose, high-level programming language. Specialized for web applications, apps, commonly used in plugins (ImageJ). Ruby -- A very high-level programming language. R – A high level programming language and software environment specialized for statistics and large data management. MATLAB – A computing environment and programming language. Good integration for image analysis. Costs money. MYSQL – Database organization Others? 5 OS PROGRAMMING LANGUAGES MATH-y LANGUAGES DB

A HANDS-ON INTRO TO KILLDEVIL How can I use some of these resources? 6

Killdevil is a high-performance computing environment Linux operating system 1 login node 774 compute nodes – 48 – 96 GB memory per node. – 12 – 16 CPU’s cores per node. 2 large memory nodes (1 TB) 12 Graphics Processors (GPUs) nodes File systems for storage 7

No seriously, what is Killdevil? 8

Getting onto Killdevil MAC OS & Linux machines: –Link to killdevil through “Terminal” –Open “Terminal” (in Applications -> Utilities) –Type this: -- Add password when prompted PC – Open SSH Secure Shell Client – Click on “Quick Connect” – Hostname = killdevil.unc.edu – Username = – Port Number = 22 – Add password when prompted $ ssh 9

WHAT IS LINUX? WHAT IS BASH? 10

Linux is a lifestyle Linux is an operating system born out of UNIX Linux comes in many flavors Linux is the most prominent example of the free, open-source movement Linux embodies a philosophy of respect for its users 11

bash is the shell for most linux distros 12

NAVIGATING THE LINUX ENVIRONMENT 13

Getting oriented Commands Manuals Your first two commands: – whoami – Date Learn more about built-in utilities with man $ whoami erinosb $ date Thu Apr 9 13:24:09 EDT $ man whoami

Navigating – paths and directories pwd – Print Working Directory cd – Change Directory cd ls – List Contents $ pwd $ cd /nas02/home/ $ ls 15

Typical File Structures and Paths 16

The Killdevil file structure Directories and sub-directories are “folders” Some important directories on Killdevil killdevil/#P63_ killdevil/#P63_6342 – ms/ mass storage – netscr/scratch space – ~home directory Making a new directory mkdir Removing a directory rm –ri $ mkdir 01_HTLHTCode $ cd 01_HTLTCode $ ls $ mkdir 01_week1 $ cd 01_week1 $ ls 17

Exercise #1 18

A few key tips and tricks Naming conventions –NO SPACES! Auto complete with TAB Beginning of code line –CTRL + A End of code line –CTRL + E What if I get stuck? –CTRL+C &#$%! Get me out of here! –Q –CTRL+C –CTRL+D –quit –logout –logoff –logout() –bye –quit() –q() –exit What if I need help? – man – -h – --help – GOOGLE it! – Use language name in search 19

Making and Removing files Making a file $ touch Removing a file $ rm –i $ command [-OPTIONS] $ cd $ ls $ cd 01_HTLTCode $ ls $ cd 01_week1 $ ls $ touch _NOTES.txt 20

Editing files nano, vi -- OK, but cumbersome –CTRL + X to exit –Type “y” to save SFTP client – better! –Cyberduck, Mozilla –SSH/SFTP Set it up, then drag and drop 21 $ nano _NOTES.txt

Getting files onto and off of Kure sftp clients –Cyberduck, Mozilla –SSH/SFTP Set it up, then drag and drop scp sftp, wget 22

Copying 23 copying a file $ cp OR $ cp OR $ cp Copying a directory $ cp –r OR $ cp –r

moving/renaming Renaming: $ mv Moving: $ mv OR $ mv EXERCISE 3 24

Exploring files diff – difference between two files wc – count lines in files * is useful – wild card. Zero, one or more of any character. 25

bash Hello World 26

Capturing information -- variables $ x=42 $ echo x $ echo $x $ x=“onyen” $ echo $x $ echo ${x} $ echo “$x” $ echo ‘$x’ 27

Capturing information -- arrays $ starks= ( “robb” “sansa” “arya” “bran” “rickon” ) $ echo $starks $ echo ${starks} $ echo ${starks[0]} $ echo ${starks[1]} $ echo ${starks[*]} $ starks[1]=“SANSA” $ echo ${starks[1]} 28

Don’t use all caps to name variables printenv shows environment variables 29