Laboratory 1.2a1 First steps with Unix - Lab Boris Steipe Department of Biochemistry Department.

Slides:



Advertisements
Similar presentations
Learning Unix/Linux Bioinformatics Orientation 2008 Eric Bishop.
Advertisements

1 Introduction to UNIX Ke Liu
NETW-240 Shells Last Update Copyright Kenneth M. Chipps Ph.D. 1.
©Colin Jamison 2004 Introduction to Linux Colin Jamison.
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.
More Shell Basics CS465 - Unix. Unix shells User’s default shell - specified in /etc/passwd file To show which shell you are currently using: $ echo $SHELL.
Linux Linux File System.
Unix Basics. Systems Programming: Unix Basics 2 Unix Basics  Unix directories  Important Unix file commands  File and Directory Access Rights through.
7/17/2009 rwjBROOKDALE COMMUNITY COLLEGE1 Unix Comp-145 C HAPTER 2.
Linux Commands LINUX COMMANDS.
L INUX C OMMAND L INE I NTERFACE G UNAANBAN.G
CS 141 Labs are mandatory. Attendance will be taken in each lab. Make account on moodle. Projects will be submitted via moodle.
Systems Programming Concepts
Introduction to Linux Workshop February Introduction Rob Lane & The HPC Support Team Research Computing Services CUIT.
Learning basic Unix command IT 325 operating system.
Brief introduction to UNIX A. Emerson CINECA, High Performance Systems.
File Systems Sources and Resources: 1. A Students Guide to UNIX, by Hahn 2. Paula Davidson’s Handout on UNIXHandout on UNIX.
Unix Primer. Unix Shell The shell is a command programming language that provides an interface to the UNIX operating system. The shell is a “regular”
Chapter 9 Part II Linux Command Line Access to Linux Authenticated login using a Linux account is required to access a Linux system. The Linux prompt will.
CHAPTER 1 UNIX FOR NONPROGRAMMERS By U ğ ur Halıcı.
Linux Directory Navigation. File & Directory Commands This is a minimal list of Unix commands that you must know for file management: ls (list) mkdir.
1 Lecture 2 Working with Files and Directories COP 3344 Introduction to UNIX.
Unix Basics Chapter 4.
– Introduction to the Shell 10/1/2015 Introduction to the Shell – Session Introduction to the Shell – Session 2 · Permissions · Users.
Basic unix commands that everyone should know (Even if you have a mac) Slightly more advanced:
Working with Linux Lab 1 1. Login and logout Account – username & password – Note: Linux is case-sensitive Administrator: username = root Logout: exit,
PROGRAMMING PROJECT POLICIES AND UNIX INTRO Sal LaMarca CSCI 1302, Fall 2009.
System Administration Introduction to Unix Session 2 – Fri 02 Nov 2007 Reference:  chapter 1, The Unix Programming Environment, Kernighan & Pike, ISBN.
Session 2 Wharton Summer Tech Camp Basic Unix. Agenda Cover basic UNIX commands and useful functions.
UNIX Commands. Why UNIX Commands Are Noninteractive Command may take input from the output of another command (filters). May be scheduled to run at specific.
Lesson 2-Touring Essential Programs. Overview Development of UNIX and Linux. Commands to execute utilities. Communicating instructions to the shell. Navigating.
L&T Infotech1 UNIX – Getting Started - Aneesh Ramani.
BIF713 Basic Unix/Linux Commands Getting Help with Commands.
Unix Accounts. 27/11/20152 Unix Accounts To access a Unix system you need to have an account. Unix account includes: username and password userid and.
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: whereis, which, whoami, finger, passwd, cal, date Working with Files: cat, more, less.
E X C E E D I N G E X P E C T A T I O N S Basic LINUX Linux System Administration Dr. Hoganson Kennesaw State University Operating Systems Directory structure:
Introduction to Programming Using C An Introduction to Operating Systems.
Λειτουργικά Συστήματα – Lab2 Γιάννης Πετράκης. Directory Navigation and Control  The Unix file system is set up like a tree branching out from the root.
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: which, passwd, date, ps / kill Working with Files: file, touch, cat, more, less, grep,
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 2a – A Unix Command Sampler (Courtesy of David Notkin, CSE 303)
Linux Commands C151 Multi-User Operating Systems.
File Systems, telnet and ftp Sources and Resources: 1. A Students Guide to UNIX, by Hahn 2. Paula Davidson’s Handout on UNIXHandout on UNIX.
2 Manual & Filestore Mauro Jaskelioff. Introduction Using the manual The UNIX filestore File permissions.
1 Lecture 2 Working with Files and Directories COP 3353 Introduction to UNIX.
1 Introduction to Unix. 2 What is UNIX?  UNIX is an Operating System (OS).  An operating system is a control program that helps the user communicate.
1 CS3695 – Network Vulnerability Assessment & Risk Mitigation – Introduction to Unix & Linux.
UNIX file systems Learning Objectives: 1. To understand the basics of file systems 2. To understand the hierarchical structure in Unix file system 3. To.
Learning basic Unix command It 325 operating system.
File Management commands cat Cat command cat cal.txt cat command displays the contents of a file here cal.txt on screen (or standard out).
Linux Tutorial Lesson Two *Getting Help in Linux *Data movement and manipulation *Relative and Absolute path *Processes Note: see chapter 1,2,3 from Linux.
Tutorial 1.21
Learning Unix/Linux Based on slides from: Eric Bishop.
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.
Tutorial of Unix Command & shell scriptS 5027
Commands Basic syntax of shell commands UNIX or shell commands have a basic structure command -options target command comes first (such as cd or ls) any.
Linux Commands Help HANDS ON TRAINING Author: Muhammad Laique
Andy Wang Object Oriented Programming in C++ COP 3330
Lecture 2 Working with Files and Directories
Some Linux Commands.
C151 Multi-User Operating Systems
The Command Prompt Commands are the way to “do things” in Unix
CSE 374 Programming Concepts & Tools
Basic UNIX OLC Training.
Introduction to UNIX.
Using Linux Commands Lab 3.
Web Programming Essentials:
Andy Wang Object Oriented Programming in C++ COP 3330
Linux Commands LINUX COMMANDS.
January 26th, 2004 Class Meeting 2
Presentation transcript:

Laboratory 1.2a1 First steps with Unix - Lab Boris Steipe Department of Biochemistry Department of Molecular and Medical Genetics Program in Proteomics and Bioinformatics University of Toronto

Laboratory 1.2a2

Laboratory 1.2a3 Where is Unix ? Unix is an operating system. It is a program that runs on a computer and organizes the way the computer works. It's job is mostly behind the scenes. Except... Hard drive CPU RAM Display qwerp adjk; xbn>

Laboratory 1.2a4... when we interact directly with a "shell". user: steipe password: $

Laboratory 1.2a5 The "shell" This is real Unix !!! $

Laboratory 1.2a6 The "shell" (Actually this is the shell's prompt. Ready to take your orders.) $ $ echo $SHELL /bin/bash

Laboratory 1.2a7 Prompts % [hugin:~] steipe% coe03:/local/home/steipeb 3 % bin]$ bin]# Prompts give feedback on who/where you are... Different flavors: Simple MacOS X (tcsh) Linux (bash) Solaris (tcsh) Prompt Host Directory User # in history directory reminder... you can change the prompt (eg tcsh): set prompt =...

Laboratory 1.2a8 exit % exit Terminate a shell process and its associated subprocesses. Close a window. Log out. Usually. Except if there are stopped jobs. These you need to terminate first. poof...

Laboratory 1.2a9 Basic Unix commands cd – change directory ls – list cp– copy a file mv – move or rename a file rm– remove a file (use caution) mkdir – make a directory rmdir – remove a directory (must be empty) pwd – print working directory... see Lab notes

Laboratory 1.2a10 Who/where are we anyway ? $ pwd /home/steipe $ whoami steipe root directory Unix directory structure: / /bin /etc /home /local /usr... /home/steipe... subdirectories home directory

Laboratory 1.2a11 cd /home/steipe$ ls -l total 4 drwxr-xr-x 2 steipe wheel 512 Nov 30 01:09 project -rwx---r-- 1 steipe wheel 93 Nov 28 17:01 test.pl /home/steipe$ cd project /home/steipe/project$ ls test1.pl 1JKZ.pdb /home/steipe$ cd.. (change to parent directory) /home/steipe$ cd / (change to root directory) /home/steipe$ cd (change to home directory) change directory Or enter any full path !

Laboratory 1.2a12 Directories worth knowing /home/ : home directory /etc : system resources /usr/bin : locally installed applications /usr/local/apache/htdocs : http root directory

Laboratory 1.2a13 man % man % man -k copy % man cp [...] to page q to quit manual pages searches relevant entries by keyword

Laboratory 1.2a14 pico/nano UW PICO(tm) 4.2 File: occam.txt entia non sunt multiplicanda sine necessitatem. ^G Get Help ^O WriteOut ^R Read File ^Y Prev Pg ^K Cut Text ^C Cur Pos ^X Exit ^J Justify ^W Where is ^V Next Pg ^U UnCut Text ^T To Spell A screen based text editor invoke with: pico (Dont use special characters or blank spaces in filenames.)

Laboratory 1.2a15 ls home/steipe/project$ ls occam.txt 1JKZmdl1.pdb home/steipe/project$ ls -l total rw-r--r-- 1 steipe wheel Nov 30 00:57 1JKZ.pdb -rw-r--r-- 1 steipe wheel 49 Jan 25 00:13 occam.txt home/steipe/project$ ls -la total 2358 drwxr-xr-x 2 steipe wheel 512 Nov 30 01:09. drwxr-xr-x 7 steipe wheel 512 Nov 30 01:09.. -rw-r--r-- 1 steipe wheel Nov 30 00:57 1JKZ.pdb -rw-r--r-- 1 steipe wheel 49 Jan 25 00:13 occam.txt listlist permissions owner group size date filename

Laboratory 1.2a16 List: some commandline flags ls List files in current directory ls –F Lists files with decoration for file type ls -l Lists extra information about each file (size, ownership, permission status, and date) ls -al Lists all files including hidden files in directory and tells you information about each ls -t Lists files in order according to the date man ls Tells you what ls can do

Laboratory 1.2a17 mkdir $ cd $ mkdir test $ make a new directory

Laboratory 1.2a18 cp $ cp../steipeb/ACGC2/1JKZmdl1.pdb 1JKZmdl1.pdb $ copycopy Note: Always remember cp Note: cp cheerfully overwrites without warning.

Laboratory 1.2a19 rm $ cp JKZ1mdl1.pdb test.txt $ rm test.txt $ rm will cheerfully delete everything you tell it. Options, like rm -r are especially dangerous. $ alias rm='rm -i' $ remove safeguard: "interactive" To remove directories: empty them first, then rmdir

Laboratory 1.2a20 cat $ cat sparkle perl -e "while(){print rand>0.002?' ':'*'}" $ concatenate and display

Laboratory 1.2a21 more, head, tail $ more 1JKZmdl1.pdb [...] $ head 1JKZmdl1.pdb [...] $ head -50 1JKZmdl1.pdb [...] $ tail -15 1JKZmdl1.pdb commands to look at parts of files

Laboratory 1.2a22 a program $ perl -e 'print "Wheeeeee...\n"' type...

Laboratory 1.2a23 a "Happy Birthday" program $ perl -e "while(){print rand>0.002?' ':'*'}" type...

Laboratory 1.2a24 which $ which perl /usr/bin/perl $ which cp /bin/cp which lists the files that would be executed if the argument were entered as a command

Laboratory 1.2a25 Permission: a dissection -rwxrwxrwxEveryone can read [r], write [w] and execute [x] this file -rw Only the user can read and write this file drwxr-xr-xuser can list [r], add or delete [w], and read files [x], in this directory. The group and other can only list and read. UserGroupOther rwxrwxrwx

Laboratory 1.2a26 Changing permissions chmod - change the permissions mode of a file or directory chmod a+rw Gives everyone [r]eading and [w]riting privileges for chmod go-w+x Removes writing access and makes e[x]ecutable for [g]roup and [o]ther Note: if is a directory [x] gives reading permission and [r] merely allows you to list its contents symbolmeaning uuser ggroup oother aall +give rights -remove rights

Laboratory 1.2a27 access privileges (the generic way) chmod 755 test.pl PermissionsBinaryOctal x w wx r r-x rw rwx Example: Octal: 755 Binary: Meaning: rwx r-x r-x

Laboratory 1.2a28 & $ mozilla & $ ls [...] Executes a program in the background

Laboratory 1.2a29 ps, jobs, fg $ perl -e 'while(){print rand>0.002?" ":"*"}' [... happiness unfolds] ^Z $ $ ps PID TT STAT TIME COMMAND 5171 p1 S 0: bash 5971 p1 S 0:00.91 perl -e while(){print rand>0.002?" ":"*"} 5714 p2 S 0: bash $ jobs [1]+ Stopped perl -e 'while(){print rand>0.002?" ":"*"}' $ fg [... happyness continues to unfold] c $ ps gives details on active jobs, jobs lists suspended jobs, fg takes them to the foreground

Laboratory 1.2a30 $ perl -e 'while(){print rand>0.002?" ":"*"}' [... happiness unfolds] ^Z $ [1]+ Stopped perl -e 'while(){print rand>0.002?" ":"*"}' $ ps PID TT STAT TIME COMMAND 5171 p1 S 0: bash 5990 p1 S 0:01.09 perl -e while(){print rand>0.002?" ":"*"} $ kill $ ps PID TT STAT TIME COMMAND 5171 p1 S 0: bash [1]+ Killed perl -e 'while(){print rand>0.002?" ":"*"}' $ kill Terminate a running process

Laboratory 1.2a31 End of this section