Research. We make it happen. Unix Basics. User Support Group help-line: personal:

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

Computer Systems and Architecture

UNIX Quick Reference

Introduction to UNIX command-line

Unix Essentials. BaRC Hot Topics Bioinformatics and Research Computing Whitehead Institute October 12 th

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

Introduction to Linux Organizing Files

Computer Systems and Architecture

Perl and R Scripting for Biologists

BIOINFORMATICS POST-DIPLOMA PROGRAM SUBJECT OUTLINE Subject Title: OPERATING SYSTEMS AND PROJECT MANAGEMENT Subject Code: BIF713 Subject Description:

Session 1: Accessing MUGrid and Command Line Basics

Oxford University Computing Services. Getting Started with Unix

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]

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

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

Chapter-3. Introduction to Unix: Fundamental Commands

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

Unix Tutorial Haverford Astronomy 2014/2015

UoW HPC Quick Start. Information Technology Services University of Wollongong. ( Last updated on October 10, 2011)

Introduction to the Linux Command Line

First of all, these notes will cover only a small subset of the available commands and utilities, and will cover most of those in a shallow fashion.

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

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

Introduction p. 1 Who Should Read This Book? p. 1 What You Need to Know Before Reading This Book p. 2 How This Book Is Organized p.

UNIX Quick Reference

Unix tutorial. Thanks to Michael Wood-Vasey (UPitt) and Beth Willman (Haverford) for providing Unix tutorials on which this is based.

Introduction to UNIX Command Line

Introduction to UNIX/Linux

Basic Survival UNIX.

Introduction: What is Unix?

Lab 2: Linux/Unix shell

Command-line interpreters

Linux Command Line Primer. By: Scott Marshall

Introduction to UNIX command-line II

Introduction to Unix: Fundamental Commands

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

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

Outline. Structure of a UNIX command

Read the relevant material in Sobell! If you want to follow along with the examples that follow, and you do, open a Linux terminal.

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

IMPORTANT: Logging Off LOGGING IN

Introduction to Linux

CSCE 212H, Spring 2008, Matthews Lab Assignment 1: Representation of Integers Assigned: January 17 Due: January 22

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

CS CS Tutorial 2 2 Winter 2018

CSCI 2132 Software Development. Lecture 4: Files and Directories

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

CS Fundamentals of Programming II Fall Very Basic UNIX

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

Bioinformatics. Computational Methods I: Genomic Resources and Unix. George Bell WIBR Biocomputing Group

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

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

Introduction to Linux

Week 2 Lecture 3. Unix

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

Unix L555. Dept. of Linguistics, Indiana University Fall Unix. Unix. Directories. Files. Useful Commands. Permissions. tar.

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

Appendix B WORKSHOP. SYS-ED/ Computer Education Techniques, Inc.

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

Linux command line basics II: downloading data and controlling files. Yanbin Yin

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

Introduction to Linux

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

System Administration

Computer Architecture Lab 1 (Starting with Linux)

Introduction to Linux

CS197U: A Hands on Introduction to Unix

CHE3935. Lecture 1. Introduction to Linux

CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX

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

Getting your department account

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

Embedded Linux Systems. Bin Li Assistant Professor Dept. of Electrical, Computer and Biomedical Engineering University of Rhode Island

Basic Shell Commands

Getting Started with UNIX

Introduction to Linux Workshop 1

Tutorial-1b: The Linux CLI

UNIX and Linux Essentials Student Guide

An Introduction to Unix

Getting started with Hugs on Linux

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

M.C.A. (Sem.-lll) (CBCS) Examination November CCA-3003 Operating System and LinuxlUnix programming

INSE Lab 1 Introduction to UNIX Fall 2017

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

Operating Systems. Copyleft 2005, Binnur Kurt

Basic Unix Commands. CGS 3460, Lecture 6 Jan 23, 2006 Zhen Yang

Lab Working with Linux Command Line

Getting Started With UNIX Lab Exercises

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

Linux Nuts and Bolts

Practical Session 0 Introduction to Linux

Unix Workshop Aug 2014

Lecture # 2 Introduction to UNIX (Part 2)

Mills HPC Tutorial Series. Linux Basics I

Getting started with Hugs on Linux

Common UNIX Commands. Unix. User Interfaces. Unix Commands Winter COMP 1270 Computer Usage II 9-1. Using UNIX. Unix has a command line interface

Useful Unix Commands Cheat Sheet

An Introduction to Cluster Computing Using Newton

Introduction to Linux and Cluster Computing Environments for Bioinformatics

5/20/2007. Touring Essential Programs

Transcription:

Research. We make it happen. Unix Basics Presented by: Patton Fast User Support Group help-line: help@msi.umn.edu 612-626-0802 personal: pfast@msi.umn.edu 612-625-6573

Outline I. Warnings! II. III. IV. Basic Concepts Basic Commands The Fun Stuff V. Resources Please Ask Questions!

Warnings! If you delete a file, it is GONE! The file can only be retrieved from a backup. If you overwrite a file it has been changed forever. The original file can only be restored from a backup. Home directories are backed up nightly. The scratch spaces are NOT backed up! Bottom line? Be Careful With Your Files!

Warnings! scratch space Scratch Space Time Limits! Regatta (/regscratch1 and /regscratch2) 7 days, 50 Gb SP (/scratch1 and /scratch2) 7 days, 50 Gb Altix (/scratch1 and /scratch2) 14 days Netfinity (/scratch1 and /scratch2) 14 days SDVL (/scratch) 14 days BSCL (/wrk and /wrk2) 14 days Bottom line? Be Careful With Your Files!

Basic Concepts resources IBM pseries 312 Power4 processors 664 Gb of memory 7 Tb of storage SGI Altix 176 Itanium2 processors 352 Gb of memory 5 Tb of storage http://www.msi.umn.edu/pseries http://www.msi.umn.edu/altix IBM SP 370 Power3 processors 663 Gb of memory 4 Tb of storage Netfinity Linux Cluster 160 Xeon processors 224 Gb of memory 2.0 Tb of storage http://www.msi.umn.edu/sp http://www.msi.umn.edu/netfinity www.msi.umn.edu/user_support

Basic Concepts resources Basic Sciences Computing Lab 48 CPU SGI Altix 16 CPU SGI Onyx4 9 SGI Octanes 8 CPU Sun UltraSparcIII 1 SunBlade 2000 2.5 Tb of storage http://www.msi.umn.edu/bscl Med. Chem./Supercomputing Inst. Vis. Workstation Lab 3 SGI Octanes 3 SGI O2 s 2 SunBlade 2000s http://www.msi.umn.edu/vwl Scientific Dev. & Vis. Lab 9 SunBlade 2000s 7 SGI Octanes 1 SGI Onyx http://www.msi.umn.edu/sdvl Computational Genetics Lab 16 CPU SunFire 6800 4 Dell PCs 1 Mac G5 1 SGI Fuel 1 SGI Tezro 1 IBM IntelliStation http://www.msi.umn.edu/cgl www.msi.umn.edu/user_support

Basic Concepts console Console Login: Enter username Enter password Consoles normally have a graphical-windows type interface, and always have priority over remote logins. Console Logout: Logout procedures vary between consoles. Make sure you logout! Otherwise your files and account are open to the next person. You could be logged out by an administrator.

Basic Concepts changing passwords After your first login you should change your initial password to something that is easy for you to remember, but not easy for someone to guess. %> yppasswd (Institute machines) %> passwd (general) You should NEVER give your password to anyone! If you forget your password, send a message to help@msi.umn.edu and your password will be reset. Note: Never share accounts or passwords!

Basic Concepts remote login ssh [options] machine secure shell; a program for logging into a remote machine providing encrypted communications between machines options: -l login name -X sets environment variables for porting X-display example: type: ssh -l pfast sp type: ssh bi2 SSH clients: http://www.msi.umn.edu/user_support/ssh open a secure connection for the user pfast on the machine sp.msi.umn.edu open a secure connection to bi2.msi.umn.edu with current username

Basic Concepts forwarding email Why? How? So that you get all of your email sent to one account. Makes it easier for sys admins to communicate with you. 1) Create the file.forward in your home directory 2) On the first line: your.email@desired.location 3) Create this same file in all of your accounts that you want to forward.

Basic Concepts command line help man [options] command displays manual pages about command -k keyword search for a command info command displays Info document of command When in doubt, check the man/info pages! Need extra details? Check the man/info pages!

Basic Concepts file structure overview / bin@ home/ lib@ scratch/ usr/ user1/ user2/ bin/ lib/ local/ file1.cshrc mail/ source/ work/ more* proj1/ proj2/ user1/ user2/ input output dir1/ dir2/ directory ( / ) executable ( * ) link ( @ ) file1/ file2/

Basic Concepts metacharacters? single character wild card * wild card, arbitrary number of characters ~ home directory of current user ~name home directory of user name. current directory.. parent directory (back one)

Basic Concepts command anatomy command [options] argument example: [options] (usually preceded by a dash) ls -al /scratch command name argument (quite often a filename or directory) Note: UNIX commands, options, and arguments are all CasE sensitive!

Basic Commands Command ls [options] dirname pwd mkdir dirname cd dirname mv [options] source destination cp [options] source destination rm [options] source ssh [options] hostname scp [options] user@host1:file user@host2:file Description list the contents of dirname display full pathname create the directory dirname change to the directory dirname move a file or directory copy a file or directory remove a file or directory remote login remote copy; file transfer skip basic commands

Listing Contents ls [options] dirname list the contents of dirname options: -a list all files including hidden files [hidden files are preceded by a. ; eg.cshrc] -l long listing showing ownership, permissions, and links examples: type: ls /home/user/temp view the contents of a directory with absolute pathname /home/user/temp type: ls../../temp list the contents of a directory using a relative path.

Make Directory mkdir dirname create the directory dirname examples: type: mkdir work create the directory work/ in the current working directory type: mkdir work/proj1 create the directory proj1/ in the work/ directory type: mkdir /wrk/user2 create the directory user2/ in the /wrk/ directory

Change Directory cd cd dirname change to your home directory change to the directory dirname examples: type: cd ~tom change to tom s home directory type: cd /wrk/user2 change to the directory /wrk/user2

Moving or Renaming mv [options] presname newname mv [options] srcfile destdir rename a file move a file to another directory options: example: -i confirm overwrites type: mv ~user1/file./outputfile moves file from user1 s home directory to the current working directory and renames it output file Note: Be careful when overwriting files!

Copying cp [options] srcfile destfile cp [options] srcfile destdir copy a file to another filename copy a file to another directory options: example: -i confirm overwrites -R recursively copy a directory and its contents, copies symbolic links type: cp -R proj1 proj2 copy the directory proj1/ and name it proj2/ Note: Be careful when overwriting files!

Copying cp [options] srcfile destfile cp [options] srcfile destdir Tip: copy a file to another filename copy a file to another directory options: If you have large files to -i move from confirm the scratch overwrites -R directories,copy recursively (cp) copy them a directory and its rather than contents, moving copies (mv) symbolic links them. example: type: cp -R proj1 proj2 copy the directory proj1/ and name it proj2/ Note: Be careful when overwriting files!

Removing rm [options] filename remove a file options: example: -f remove without prompting -i confirm removal -r recursively remove a directory and its contents type: rm -rf /scratch/user2/dir1 remove the directory /scratch2/user2/dir1 and its contents Note: Be careful when removing files! Especially with wild cards (*,?)!

Remote Copy scp [options] host:file1 host:file2 secure copy; copy files between hosts on a network using the ssh protocol options: -r recursive (used for directories) example: type: scp pfast@wind: output/*.out. type: scp -r mail origin:mail_copy copy the output files from host wind with username pfast to current directory copy the mail directory to the origin and rename the directory mail_copy Note: You can use sftp if scp is not available.

Remote Copy scp [options] host:file1 host:file2 Tip: secure copy; copy files between hosts on a network using the ssh protocol options: -r recursive (used for directories) If you have large files to example: transfer, use sftp instead of scp. type: scp pfast@wind: output/*.out. type: scp -r mail origin:mail_copy copy the output files from host wind with username pfast to current directory copy the mail directory to the origin and rename the directory mail_copy Note: You can use sftp if scp is not available.

Changing Permissions chmod [options] who ops permission filename change file permissions use ls -l to view permissions options R recursively change permissions who can be any combination of: u (user) g (group) o (other/world) a (all or ugo) ops adds or takes away permission, and can be: + (add permission) (remove permission) permission can be any combination of: r (read) w (write) x (execute) X (check user first)

Command Repetition history!string up/down arrows left/right arrows Control-E Control-A display list of most recent commands repeat command beginning with string scroll up and down through most recent commands; csh and tcsh use for editing current line end of line beginning of line examples: type:!ls repeat last ls command

Command Completion TAB or Control-D finish the current command, filename, or directory if possible, or show the possible completers (works with c and tc shells)

Tarring tar [options] files collect or extract files or directories into or from an archive options: c create a new archive x extract files from archive f store files in archive v print function letter and name of files store to standard output example: type: tar xvf file.tar extract the files and or directories from the archive, file.tar

Compression compress file uncompress file.z gzip file gunzip file.gz compress file and rename it file.z (the program automatically renames the file) uncompress file.z and rename it file compress file and rename it file.gz (the program automatically renames the file) uncompress file.gz and rename it file

Process Control Control-C Control-Z jobs bg fg & example: cancel a foreground job stop (interrupt) a foreground job list of background jobs type: blastp swissprot test.seq > test.out & run stopped job in the background run stopped job in the foreground appended to the end of a command will place that job in the background run WU-BLAST job in the background

Process Control ps [options] display the status of the current processes and the process id-number options: -a all processes -u display processes owned by a particular user jobs shows any jobs that are currently running in the background or suspended

Process Control kill 9 id-number terminate a process owned by you; idnumber (process id) can be found with the ps command or kill %job-number terminate a process owned by you; jobnumber can be found with the jobs command

Other Commands du -sk file df stat file quota -v display total disk usage of file or directory in kilobytes display the current disk usage for all connected file systems view attributes of a file or directory list your disk quota

Viewers cat [options] files dumps the contents of files to the screen more [options] files less file a pager, that lets you view one page at a time similar to more, but better

Editors Graphical: nedit filename xemacs filename if not available, ask to have it installed (jot no longer works on SGI) Command-line: pico filename vi filename full-screen text editor available on most UNIX systems full-screen text editor available on virtually every UNIX system

The Fun Stuff redirect > command output redirection (create new, overwrites existing file) >> command output redirection (append) < command input redirection (from file) examples: how to: type: how to: type: combine individual sequence files into one file cat seq1 seq2 > seq email a file to a collaborator mail -s results collab@umn.edu < new_blast_results

The Fun Stuff piping command1 command2 directs standard output of one command into standard input for the next command examples: type: ls -al more type: qstat -a grep user1 look at the ls output one page at a time check the queue on the origin for any processes being run by user1

The Fun Stuff pattern searching grep [options] string file options: find and print out lines containing the string in a file or multiple files examples: -i ignore case how to: extract sequence information from protein structure files type: grep SEQRES pdbfile cut -c20-70 > seqs

The Fun Stuff.cshrc file.cshrc Some things to add to your.cshrc file: alias alias-string com-string examples: shell startup file abbreviate a command string with an alias string type: alias la ls -a create a shortcut for ls -a type: alias q qstat -u pfast module load(unload) software source /usr/local/gcg/gcgstartup check if you have any jobs running in the queue (origin) load or unload the environment settings for a particular software runs the gcgstartup script to set the necessary env. variables

Resources UNIX in a Nutshell by O Reilly Developing Bioinformatics Computer Skills by O Reilly http://www.iats.missouri.edu/servlets/knowledgebase/article/422 http://www.geek-girl.com/unix.html http://riceinfo.rice.edu/computer/documents/unix/unix1.01.pdf