Introduction: What is Unix?

Similar documents
Mills HPC Tutorial Series. Linux Basics I

CISC 220 fall 2011, set 1: Linux basics

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

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

CENG 334 Computer Networks. Laboratory I Linux Tutorial

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

Introduction to Linux Workshop 1

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

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

The Unix Shell & Shell Scripts

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

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

CSCI 2132 Software Development. Lecture 4: Files and Directories

Perl and R Scripting for Biologists

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

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

Introduction to the Linux Command Line

CS CS Tutorial 2 2 Winter 2018

EECS2301. Lab 1 Winter 2016

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

Introduction to the UNIX command line

Quick Start Guide. by Burak Himmetoglu. Supercomputing Consultant. Enterprise Technology Services & Center for Scientific Computing

Introduction to Linux for BlueBEAR. January

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

This lab exercise is to be submitted at the end of the lab session! passwd [That is the command to change your current password to a new one]

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

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

Advanced Linux Commands & Shell Scripting

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

Quick Start Guide. by Burak Himmetoglu. Supercomputing Consultant. Enterprise Technology Services & Center for Scientific Computing

Introduction to Unix: Fundamental Commands

Basic UNIX commands. HORT Lab 2 Instructor: Kranthi Varala

Unix basics exercise MBV-INFX410

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

Lab Working with Linux Command Line

Chapter-3. Introduction to Unix: Fundamental Commands

Lab 2: Linux/Unix shell

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

CS246 Spring14 Programming Paradigm Notes on Linux

Linux Command Line Primer. By: Scott Marshall

Part I. UNIX Workshop Series: Quick-Start

Essentials for Scientific Computing: Bash Shell Scripting Day 3

Files and Directories

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

Unix Shells and Other Basic Concepts

Introduction in Unix. Linus Torvalds Ken Thompson & Dennis Ritchie

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

Linux Command Line Interface. December 27, 2017

A Brief Introduction to Unix

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

Introduction To Linux. Rob Thomas - ACRC

Answers to AWK problems. Shell-Programming. Future: Using loops to automate tasks. Download and Install: Python (Windows only.) R

Introduction of Linux

AMS 200: Working on Linux/Unix Machines

Useful Unix Commands Cheat Sheet

Introduction To. Barry Grant

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

Operating Systems. Copyleft 2005, Binnur Kurt

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

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

Essential Linux Shell Commands

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

Unix Introduction to UNIX

CSCI 2132 Software Development. Lecture 5: File Permissions

CHAPTER 1 UNIX FOR NONPROGRAMMERS

Command-line interpreters

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

Introduction to Linux

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

Exercise 1: Basic Tools

Computer Systems and Architecture

Introduction to Linux Basics

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

Unix. Examples: OS X and Ubuntu

Outline. Structure of a UNIX command

CS4350 Unix Programming. Outline

CSE 391 Lecture 1. introduction to Linux/Unix environment

CENG393 Computer Networks Labwork 1

CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX

CS Fundamentals of Programming II Fall Very Basic UNIX

EECS 2031E. Software Tools Prof. Mokhtar Aboelaze

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

Introduction to UNIX. Introduction. Processes. ps command. The File System. Directory Structure. UNIX is an operating system (OS).

Introduction to UNIX. CSE 2031 Fall November 5, 2012

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

Shell. SSE2034: System Software Experiment 3, Fall 2018, Jinkyu Jeong

Week 2 Lecture 3. Unix

Connecting to ICS Server, Shell, Vim CS238P Operating Systems fall 18

Version Control with Git

: the User (owner) for this file (your cruzid, when you do it) Position: directory flag. read Group.

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

Introduction to UNIX Command Line

Files

Scripting Languages Course 1. Diana Trandabăț

Short Read Sequencing Analysis Workshop

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

Introduction to Linux Part 1. Anita Orendt and Wim Cardoen Center for High Performance Computing 24 May 2017

Chapter 1 - Introduction. September 8, 2016

5/20/2007. Touring Essential Programs

Introduction to Linux Environment. Yun-Wen Chen

Transcription:

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 was the predecessor of Linux Linux is a variant of Unix So is Mac OS X, so much of this tutorial applies to Macs as well Linux is open source Most of the machines you ll use in the Bioinformatics program are running the Linux OS

Linux Distribution Ubuntu Debian Knoppix Slackwar e Ubuntu Centos OS Redhat SUSE Debian. Gento o CentOS Redhat

Introduction: Why Unix/Linux? Linux is free It s fully customizable It s stable (i.e. it almost never crashes) These characteristics make it an ideal OS for programmers and scientists

Connecting to a Unix/Linux system Open up a terminal: Putty Mac

Mac : Terminal : ssh your_username@bbcsrv3.biotech.uconn.edu Windows : Putty Open Putty it will open window1. 1. Provide host name e.g. ssh your_username@bbcsrv3.biotech.uconn.eduexpand SSH tab and select X11 (shown in window2) 2. Enable X11 forwarding by selecting it. (window2) 3. Scroll up the left panel and select Session.(window1) 4. Name your session e.g. BBC_cluster and click save tab to save. 5. Your session name should appear in saved sessions. Double click on your session name to connect to server with SSH session.

Connecting to a Unix/Linux system Open up a terminal: The prompt The current directory ( path ) The host

What exactly is a shell? After logging in, Linux/Unix starts another program called the shell The shell interprets commands the user types and manages their execution The shell communicates with the internal part of the operating system called the kernel The most popular shells are: tcsh, csh, korn, and bash The differences are most times subtle For this tutorial, we are using bash Shell commands are CASE SENSITIVE!

Unix/Linux File System NOTE: Unix file names are CASE SENSITIVE! /home/mary/ /home/john/portfolio/ The Path

Creating files in Unix/Linux Requires the use of an Editor Various Editors: 1) nano 2) vim 3) emacs

Login into remote server ssh -X <your_username>@<host_name> ssh vsingh@bbcsrv3.biotech.uconn.edu Basic Linux commands pwd ls ls -l ls -a ls -R ls -t # Get full path of the present working directory (same as "echo $HOME") # Content of pwd # Similar as ls, but provides additional info on files and directories # Includes all files including hidden files (.name) as well # Lists subdirectories recursively # Lists files in chronological order

Basic Linux commands cont.. cd <dir_name> cd # Brings you to the highest level of your home directory. cd.. # Moves one directory up cd../../ # Moves two directories up (and so on) cd - # Go back to you were previously (before the last directory change) echo ~ find ~ ls ~ # View the full (complete) path of your home # List all your files (including everything in sub-directories) # List the top level files of your home directory

Basic Linux commands cont.. mkdir <dir_name> rmdir <dir_name> rm <file_name> rm -r <dir_name> cp <name> <path> # Creates specified directory # Removes empty directory # Removes file name # Removes directory including its content, but asks for confirmation,'f' argument turns confirmation off # Copy file/directory as specified in path (-r or -a to include content in directories) mv <name1> <name2> # Renames directories or files mv <name> <path> # Moves file/directory as specified in path

Basic Linux commands cont.. man <something> # general help (press the 'q' key to exit) man wc # manual on program 'word count' wc wc --help # short help on wc cat <file1> # Print contents of file1 cat <file1> <file2> > <cat.out> # concatenate files in output file 'cat.out paste <file1> <file2> > <paste.out> # merges lines of files and separates them by tabs (useful for tables) cmp <file1> <file2> # tells you whether two files are identical diff <filea> <fileb> # finds differences between two files head -<number> <file> # prints first lines of a file tail -<number> <file> # prints last lines of a file

Basic Linux commands cont.. Files and permission r means read only permission w means write permission x means execute permission In case of directory, x grants permission to list directory contents xanadu-submit-ext ~ $ ls l total 892 -rw-r--r-- 1 vsingh domain users 257 Jun 2 09:18. drwxr-xr-x 7 vsingh domain users 1601 May 2 21:26 aening_masurca -rw-r--r-- 1 vsingh domain users 499 Jun 2 00:39 arrayjob.sh drwxr-xr-x 2 vsingh domain users 1431 Jun 2 00:39 arrayout -rwxr-xr-x 1 vsingh domain users 19384 Jun 16 12:07 assemble_xandu2.sh -rw-r--r-- 1 vsingh domain users 649 Jun 14 13:30 basemount_cp.sh Other/world (safe: r-x) : o Group (safe: r-x) : g User : u File(-) or directory (d)

Basic Linux commands cont.. Change permission If you own the file, you can change it s permissions with chmod Syntax: chmod [user/group/others/all]+[permission] [file(s)] Below we grant execute permission to all:

Basic Linux commands cont.. Running a program (a.k.a a job) Make sure the program has executable permissions chmod u+x program Use./ to run the program./ program INPUT/OUTPUT: STDIN STDOUT and redirecting (Pipes) program_a > file.txt program_a s output is written to a file called file.txt program_a < input.txt program_a gets its input from a file called input.txt Programs can output to other programs Called piping program_a program_b program_a s output becomes program_b s input

Exercise 1: Create a file myscript.sh Check for file Open file to edit Write commands: interpreter save and exit Check permissions of file Change permission if required Run script/program : touch myscript.sh : ls : vi myscript.sh : i : #!/bin/bash : echo Hello world : echo This is my first script in Linux. : esc-:-w-q-! : ls l myscript.sh : chmod u+x myscript.sh :./myscript.sh : sh myscript.sh Store output to a file Check the output (limited) print the contents : sh myscript.sh > myscript_output.txt : less myscript_output.txt : cat myscript_output.txt Count the number of lines : cat myscript_output.txt wc -l

Transferring files between systems Filezilla: https://filezilla-project.org/

1: Host: sftp://bbcsrv3.biotech.uconn.edu 2: Username: 3. Password 4.Quickconnect

STDIN, STDOUT, STDERR, Redirections <beginning-of-filename>* # * is wildcard to specify many files ls > file # prints ls output into specified file command < my_file # uses file after '<' as STDIN command >> my_file # appends output of one command to file command tee my_file # writes STDOUT to file and prints it to screen command > my_file; cat my_file # writes STDOUT to file and prints it to screen command > /dev/null # turns off progress info of applications by redirecting their output to /dev/null grep my_pattern my_file wc # Pipes ( ) output of 'grep' into 'wc' grep my_pattern my_non_existing_file 2 > my_stderr # prints STDERR to file > file redirects stdout to file 1> file redirects stdout to file 2> file redirects stderr to file &> file redirects stdout and stderr to file /dev/null is the null device it takes any input you want and throws it away. It can be used to suppress any output.