Introduction to UNIX/Linux

Similar documents
Linux Command Line Primer. By: Scott Marshall

Computer Systems and Architecture

IPSL BootCamp: Unix commands

CS370 Operating Systems

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

Computer Systems and Architecture

Introduction to UNIX command-line

Chap2: Operating-System Structures

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

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

Introduction to the UNIX command line

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

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]

Analytical Processing of Data of statistical genetics research in UNIX like Systems

Some useful UNIX Commands written down by Razor for newbies to get a start in UNIX

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

Chapter-3. Introduction to Unix: Fundamental Commands

Introduction To Linux. Rob Thomas - ACRC

CISC 220 fall 2011, set 1: Linux basics

Introduction to the Linux Command Line

Introduction to Linux Organizing Files

UNIX Quick Reference

Linux Essentials Objectives Topics:

Introduction to Unix: Fundamental Commands

Introduction: What is Unix?

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

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

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 II

UNIX Quick Reference

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

An Introduction to Unix

Working with Basic Linux. Daniel Balagué

Perl and R Scripting for Biologists

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

Hitchhiker s Guide to VLSI Design with Cadence & Synopsys

INTRODUCTION TO LINUX

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

Operating Systems. Copyleft 2005, Binnur Kurt

Introduction to Linux Workshop 1

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

Introduction to Linux

Introduction of Linux

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

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

Tutorial-1b: The Linux CLI

Basic Linux Command Line Interface Guide

Introduction to Linux for BlueBEAR. January

Introduction to Unix and Linux. Workshop 1: Directories and Files

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

Useful Unix Commands Cheat Sheet

Linux Shell Script. J. K. Mandal

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

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

Outline. Structure of a UNIX command

CHEM5302 Fall 2015: Introduction to Maestro and the command line

Linux Nuts and Bolts

Unix Introduction to UNIX

LAB #7 Linux Tutorial

CS Fundamentals of Programming II Fall Very Basic UNIX

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

CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX

The Unix Shell & Shell Scripts

Basic Linux Command Line Interface Guide

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.

CS4350 Unix Programming. Outline

Make use of SSH

Exercise 1: Basic Tools

Introduction To. Barry Grant

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

Introduction to Linux

Unix Tutorial. Beginner. CS Help Desk: Marc Jarvis (in spirit), Monica Ung, Corey Antoniuk 2015

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

Linux crash lecture by Andrey Lukyanenko

Operating Systems Lab 1 (Users, Groups, and Security)

On successful completion of the course, the students will be able to attain CO: Experiment linked. 2 to 4. 5 to 8. 9 to 12.

National University of Computer and Emerging Sciences Operating System Lab - 02 Lab Manual

Introduction to Unix. University of Massachusetts Medical School. October, 2014

System Administration

Introduction to the Linux Command Line January Presentation Topics

An Introduction to Cluster Computing Using Newton

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

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

List of Linux Commands in an IPm

Linux Bootcamp Fall 2015

Basic Shell Commands

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

Unix Basics. Systems Programming Concepts

Brief Linux Presentation. July 10th, 2006 Elan Borenstein

Working With Unix. Scott A. Handley* September 15, *Adapted from UNIX introduction material created by Dr. Julian Catchen

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

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

Command-line interpreters

Linux Essentials. Smith, Roderick W. Table of Contents ISBN-13: Introduction xvii. Chapter 1 Selecting an Operating System 1

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

Getting started with Hugs on Linux

CS CS Tutorial 2 2 Winter 2018

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.

IMPORTANT: Logging Off LOGGING IN

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

Transcription:

Introduction to UNIX/Linux Biochemistry Boot Camp 2018 Session #3 Nick Fitzkee nfitzkee@chemistry.msstate.edu Operating system (OS) Some terms Command-line interface (CLI) Graphical user interface (GUI) 1

Why UNIX? Stability: Systems can run for months or more Multitasking: Easy to running many programs at once (used to be very unique) Flexibility: Graphical environment is optional, can be pared down to bare minimum, optimizing performance Why UNIX? Science focus: Lots of scientific software runs exclusively on UNIX Data Storage: Unix handles lots of files well Historical reasons: mainframes, early software written on UNIX 2

Flavors of Linux Linux only refers to the kernel: the core program that runs the operating system Many programs contribute to the OS experience: Window environment (GUI) Command line interface (CLI) Even simple utilities like the list of printers Because Linux is open-source, there lots of combinations of programs that work around the same kernel These are called distributions or distros Linux Distributions: History Distributions made installing software easier Lots of software needed for a working system Oldest and still active: Slackware Distributions frequently forked as new features added or removed Some distros also died out Linux Distrubtion, Wikipedia (Debian and Slackware Distros) 3

Common Linux Distributions CentOS: Very stable at the expense of some newer features & hardware support Ubuntu: User friendly, a good mix of cutting edge updates and stability Debian: Cutting edge, but stable software is available for installation too 4

Linux vs. Linux-like Environment An OS may provide a Linux-like (POSIX) environment without actually running the linux kernel MacOS X: XNU kernel, built around the mach kernel; readily supports Linux-like shell scripting and windowing environment (true POSIX) Windows 10: Windows kernel, but supports a Linux subsystem to provide a Linux feel (added in 2016) 1969 1981 MS-DOS 1.0 1992 Windows 3.1 (GUI) 2001 1984 (GUI) Apple System 1.0 1991 Linux 0.0.1 5

Practical Application This is all very interesting, but How do you get to a Linux-like Command Line and what can you do when you get there? Mac Users Basic command line interface can be found in the Applications/Utilities folder run the program Terminal We will use XQuartz as well, which can be found at www.xquartz.org Download and install this program while PC owners struggle through tutorial! File Transfer Client: Fugu http://rsug.itd.umich.edu/software/fugu/ 6

PC Users Getting to Linux is a bit more difficult Follow the instructions in the Running X11 on Windows handout File Transfer Client: WinSCP https://winscp.net/eng/download.php Connect to a Linux Server via SSH Mac Users Make sure XQuartz is running Open a new XTerm window and run SSH Example: ssh -Y nfitzkee@bloch.chem.msstate.edu Replace nfitzkee with your user name! PC Users Follow directions in X11 Handout using the SSH Secure Shell Program (Quick Connect) 7

Getting Files To/From the Server PC/Mac: Open up WinSCP or Fugu Old School: Open up another Xterm, then: sftp <username>@bloch.chem.msstate.edu Need to use the cd command to navigate to the right folder, then get to copy the file It will save the files to wherever you started the sftp program File transfer software: Demo: Common Linux Tasks Navigating the file system: Where am I? What s here? Copying/Manipulating Files and Directories Running programs in the background Ampersand ( & ) trick Useful commands: Ctrl-Z, bg, fg Running software via X11 Text file editing (xemacs) 8

Try It Yourself: Linux Tutorial Very helpful, and covers basic to advanced topics: http://www.ee.surrey.ac.uk/teaching/unix/ Your Linux account on bloch will be active for 30 days, after which it will be disabled Contact Dr. Fitzkee if you need more time File Commands System Info ls directory listing date show the current date and time ls -la formatted listing with hidden files cal show this month's calendar cd dir - change directory to dir uptime show current uptime cd change to home directory (e.g. /home/nfitzkee) w display who is online pwd show current directory whoami who you are logged in as mkdir dir create a directory dir finger user display information about user rm file delete file uname -a show kernel information rm -r dir delete directory dir cat /proc/cpuinfo cpu information rm -f file force remove file cat /proc/meminfo memory information rm -rf dir force remove directory dir * (see warning below!) man command show the manual for command cp file1 file2 copy file1 to file2 df show disk usage cp -r dir1 dir2 copy dir1 to dir2; create dir2 if it doesn't exist du show directory space usage mv file1 file2 rename or move file1 to file2 free show memory and swap usage if file2 is an existing directory, moves file1 into directory file2 whereis app show possible locations of app ln -s file link create symbolic link link to file which app show which app will be run by default touch file create or update file Compression cat > file places standard input into file tar cf file.tar files create a tar named file.tar containing more file output the contents of file (alternatively: less file) files head file output the first 10 lines of file tar xf file.tar extract the files from file.tar tail file output the last 10 lines of file tar czf file.tar.gz files create a tar with Gzip tail -f file output the contents of file as it grows, starting compression with the last 10 lines tar xzf file.tar.gz extract a tar using Gzip Process Management zip r file.zip files create a Windows-compatible zip ps display your currently active processes archive top display all running processes unzip file.zip extract zip archive kill pid kill process id pid gzip file compresses file and renames it to file.gz killall proc kill all processes named proc * gzip -d file.gz decompresses file.gz back to file bg lists stopped or background jobs; resume a stopped job in the Network background ping host ping host and output results fg brings the most recent job to foreground whois domain get whois information for domain fg n brings job n to the foreground dig domain get DNS information for domain File Permissions dig -x host reverse lookup host chmod octal file change the permissions of file to octal, wget file download file which can be found separately for user, group, and world by wget -c file continue a stopped download adding: Lab Utilties 4 read (r) NMR Viewers: sparky or nmrdraw or nvj or analysis 2 write (w) pipe2ucsf file.ft2 file.ucsf convert NMRPipe spectrum 1 execute (x) to UCSF format Examples: /home/databases/pdb/ location of all PDB structures chmod 777 read, write, execute for all PDB Viewers: pymol or molmol or rasmol or vmd chmod 755 rwx for owner, rx for group and world Text editors: xemacs or emacs or gedit or vi For more options, see man chmod. All can be invoked with a file, e.g. xemacs file SSH./script run an executable file script in the current directory ssh user@host connect to host as user Shortcuts ssh -p port user@host connect to host on port port as user Ctrl+C halts the current command sftp user@host connect to host as user for file transfer Ctrl+Z stops the current command, resume with fg in the gftp graphical file transfer client foreground or bg in the background Searching Ctrl+D log out of current session, similar to exit grep pattern files search for pattern in files Ctrl+W erases one word in the current line grep -r pattern dir search recursively for pattern in dir Ctrl+U erases the whole line command grep pattern search for pattern in the output of command Ctrl+R type to bring up a recent command locate file find all instances of file!! - repeats the last command find. name pattern search for the file named pattern in exit log out of current session the current directory (or below); pattern can contain wildcards (e.g. * ) * use with extreme caution. Adapted from FOSSWire.com, http://fosswire. com/post/2007/08/unixlinux-command-cheat-sheet/ 9

File Commands ls directory listing ls -la formatted listing with hidden files cd dir - change directory to dir cd change to home directory (e.g. /home/nfitzkee) pwd show current directory mkdir dir create a directory dir rm file delete file rm -r dir delete directory dir rm -f file force remove file rm -rf dir force remove directory dir * (see warning below!) cp file1 file2 copy file1 to file2 cp -r dir1 dir2 copy dir1 to dir2; create dir2 if it doesn't exist mv file1 file2 rename or move file1 to file2 if file2 is an existing directory, moves file1 into directory file2 ln -s file link create symbolic link link to file touch file create or update file cat > file places standard input into file more file output the contents of file (alternatively: less file) head file output the first 10 lines of file tail file output the last 10 lines of file tail -f file output the contents of file as it grows, starting with the last 10 lines Process Management ps display your currently active processes top display all running processes kill pid kill process id pid killall proc kill all processes named proc * date show the current cal show this month's uptime show current u w display who is online whoami who you are lo finger user display i uname -a show kernel cat /proc/cpuinfo c cat /proc/meminfo m man command show the df show disk usage du show directory spac free show memory and whereis app show pos which app show which tar cf file.tar file files tar xf file.tar extr tar czf file.tar.gz compression tar xzf file.tar.gz zip r file.zip file archive unzip file.zip extra gzip file compresses gzip -d file.gz dec tput the contents of (alternatively: ) head file output the first 10 lines of file tail file output the last 10 lines of file tail -f file output the contents of file as it grows, starting with the last 10 lines tar xf file.tar extract the files from file.tar tar czf file.tar.gz files create a tar with Gzip compression tar xzf file.tar.gz extract a tar using Gzip Process Management zip r file.zip files create a Windows-compatible zip File Commands ps display your currently active processes archive System Info top ls display directory all running listing processes unzip file.zip date extract show zip the archive current date and time kill ls pid -la kill formatted process id pid listing with hidden files killall cd dir proc - change kill all directory processes to named dir proc * bg cd lists stopped change or to background home directory jobs; resume (e.g. /home/nfitzkee) a stopped job in the gzip file cal compresses show file this and month's renames calendar it to file.gz gzip -d file.gz uptime decompresses show current file.gz uptime back to file w display who Network is online background ping host ping host and output results pwd show current directory whoami who you are logged in as fg brings the most recent job foreground whois domain get whois information for domain mkdir dir create a directory dir finger user display information about user fg n brings job n to the foreground dig domain get DNS information for domain rm file delete file File Permissions dig -x host uname reverse -a lookup show host kernel information chmod rm octal -r dir file delete change directory the permissions dir of file to octal, wget file cat download /proc/cpuinfo file cpu information which rm can -f be file found separately force remove for user, file group, and world by wget -c file cat continue /proc/meminfo a stopped download memory information adding: rm -rf dir force remove directory dir * (see warning below!) man command Lab Utilties show the manual for command 4 read (r) cp file1 file2 copy file1 to file2 NMR Viewers: df sparky show or disk nmrdraw usage or nvj or analysis 2 write (w) pipe2ucsf file.ft2 file.ucsf convert NMRPipe spectrum cp -r 1 execute dir1 dir2 (x) copy dir1 to dir2; create dir2 if it doesn't exist du show directory space usage to UCSF format Examples: mv file1 file2 rename or move file1 to file2 /home/databases/pdb/ free show location memory of and all PDB swap structures usage chmod if file2 777 is read, an existing write, execute directory, for all moves file1 into directory PDB file2 Viewers: whereis pymol or app molmol show or rasmol possible or locations vmd of app chmod ln 755 -s file rwx for link owner, create rx for group symbolic and world link link to file Text editors: xemacs which app or emacs show or which gedit app or vi will be run by default For more touch options, file see create man chmod. or update file All can be invoked with a file, e.g. xemacs Compression file SSH cat./script run an executable script in the current directory ssh user@host > file places standard input into file tar cf file.tar files create a tar named file.tar containing connect to host as user Shortcuts ssh more -p port file user@host output the connect contents to host of on file port (alternatively: port as user less file) files Ctrl+C halts the current command sftp head user@host file connect output to the host first as 10 user lines for file of file transfer tar xf file.tar extract the files from file.tar Ctrl+Z stops the current command, resume with fg in the gftp tail graphical file file output transfer the client last 10 lines of file tar czf file.tar.gz files create a tar with Gzip foreground or bg in the background tail -f file output Searching the contents of file as it grows, starting compression Ctrl+D log out of current session, similar to exit grep with pattern the last files 10 lines search for pattern in files tar xzf file.tar.gz extract a tar using Gzip Ctrl+W erases one word in the current line grep -r pattern dir search Process recursively Management for pattern in dir Ctrl+U erases zip the r whole file.zip line files create a Windows-compatible zip command ps display grep your pattern currently search active for pattern processes in the output of command Ctrl+R type archive to bring up a recent command top locate file display all running processes find all instances of file!! - repeats the unzip last command file.zip extract zip archive find kill. name pid pattern kill process search id pid for the file named pattern in exit log out gzip of current file session compresses file and renames it to file.gz the current killall directory proc (or kill below); all processes pattern can named contain proc wildcards * (e.g. gzip -d file.gz decompresses file.gz back to file * ) * use with extreme caution. bg lists stopped or background jobs; resume a stopped job in the Adapted from FOSSWire.com, http://fosswire. com/post/2007/08/unixlinux-command-cheat-sheet/ background fg brings the most recent job to foreground fg n brings job n to the foreground File Permissions chmod octal file change the permissions of file to octal, which can be found separately for user, group, and world by adding: Network ping host ping host and output results whois domain get whois information for domain dig domain get DNS information for domain dig -x host reverse lookup host wget file download file wget -c file continue a stopped download 10

output the last 10 lines of file e output the contents of file as it grows, starting 0 lines Process Management our currently active processes all running processes ill process id pid c kill all processes named proc * ped or background jobs; resume a stopped job in the e most recent job to foreground job n to the foreground File Permissions file change the permissions of file to octal, found separately for user, group, and world by ead (r) write (w) xecute (x) read, write, execute for all rwx for owner, rx for group and world ons, see man chmod. SSH st connect to host as user user@host connect to host on port port as user ost connect to host as user for file transfer cal file transfer client Searching n files search for pattern in files tern dir search recursively for pattern in dir rep pattern search for pattern in the output of find all instances of file e pattern search for the file named pattern in rectory (or below); pattern can contain wildcards (e.g. compression tar xzf file.tar.gz extract a tar using Gzip zip r file.zip files create a Windows-compatible zip archive unzip file.zip extract zip archive gzip file compresses file and renames it to file.gz gzip -d file.gz decompresses file.gz back to file Network ping host ping host and output results whois domain get whois information for domain dig domain get DNS information for domain dig -x host reverse lookup host wget file download file wget -c file continue a stopped download Lab Utilties NMR Viewers: sparky or nmrdraw or nvj or analysis pipe2ucsf file.ft2 file.ucsf convert NMRPipe spectrum to UCSF format /home/databases/pdb/ location of all PDB structures PDB Viewers: pymol or molmol or rasmol or vmd Text editors: xemacs or emacs or gedit or vi All can be invoked with a file, e.g. xemacs file./script run an executable file script in the current directory Shortcuts Ctrl+C halts the current command Ctrl+Z stops the current command, resume with fg in the foreground or bg in the background Ctrl+D log out of current session, similar to exit Ctrl+W erases one word in the current line Ctrl+U erases the whole line Ctrl+R type to bring up a recent command!! - repeats the last command exit log out of current session * use with extreme caution. re.com, http://fosswire. com/post/2007/08/unixlinux-command-cheat-sheet/ 11