Introduction to UNIX A User’s Perspective: Day 2 – Command Basics.

Slides:



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

Introduction to UNIX CSE 2031 Fall May 2015.
1 Introduction to UNIX Ke Liu
NETW-240 Shells Last Update Copyright Kenneth M. Chipps Ph.D. 1.
ATS Programming Short Course I INTRODUCTORY CONCEPTS Tuesday, Jan. 27 th, 2009 Essential Unix Commands.
Introduction to UNIX A User’s Perspective: Day 3: Advanced Commands & vi.
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.
Redirection & Pipes Understanding UNIX Input and Output.
Introduction to UNIX A User’s Perspective: Day 1 – The File System.
The Unix Shell. Operating System shell The shell is a command interpreter It forms the interface between a user and the operating system When you log.
Guide To UNIX Using Linux Third Edition
Lecture 01CS311 – Operating Systems 1 1 CS311 – Lecture 01 Outline Course introduction Setting up your system Logging onto the servers at OSU with ssh.
CMPE 151: Network Administration Spring Class Description Focus: system and network administration. Sequence of exercises. E.g., installing/configuring.
1 UNIX essentials (hands-on) the directory tree running programs the shell (using the T-shell) → command line processing → special characters → command.
Introduction to Linux and Shell Scripting Jacob Chan.
CS 141 Labs are mandatory. Attendance will be taken in each lab. Make account on moodle. Projects will be submitted via moodle.
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.
Overview of Linux CS3530 Spring 2014 Dr. José M. Garrido Department of Computer Science.
Linux environment ● Graphical interface – X-window + window manager ● Text interface – terminal + shell.
Lesson 1. PC vs. Multi-user System  Personal Computer – each user gets his/her own processor (or multicore processor).  Multi-user system – The processor,
Chapter Four UNIX File Processing. 2 Lesson A Extracting Information from Files.
Unix Basics Chapter 4.
The “File System” Under UNIX, (almost) everything is a “file”: –Normal files –Directories –Hardware –Sockets –Pipes Things that are not files: –Users –Groups.
Introduction to Unix – CS 21 Lecture 9. Lecture Overview Shell description Shell choices History Aliases Topic review.
PROGRAMMING PROJECT POLICIES AND UNIX INTRO Sal LaMarca CSCI 1302, Fall 2009.
1 UNIX essentials (hands-on) the directory tree running programs the shell → command line processing → special characters → command types → shell variables.
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.
Quiz 15 minutes Open note, open book, open computer Finding the answer – working to get it – is what helps you learn I don’t care how you find the answer,
Unix/Linux cs3353. The Shell The shell is a program that acts as the interface between the user and the kernel. –The shell is fully programmable and will.
Lesson 2-Touring Essential Programs. Overview Development of UNIX and Linux. Commands to execute utilities. Communicating instructions to the shell. Navigating.
ITR3 lecture 6: intoduction to UNIX Thomas Krichel
Lecture 24CS311 – Operating Systems 1 1 CS311 – Lecture 24 Outline Final Exam Study Guide Note: These lecture notes are not intended replace your notes.
UNIX Commands COMP 1090 Introduction to Unix Fall
Introduction to Programming Using C An Introduction to Operating Systems.
Lesson 3-Touring Utilities and System Features. Overview Employing fundamental utilities. Linux terminal sessions. Managing input and output. Using special.
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.
A Brief Overview of Unix Brandon Bohrer. Topics What is Unix? – Quick introduction Documentation – Where to get it, how to use it Text Editors – Know.
1 CS3695 – Network Vulnerability Assessment & Risk Mitigation – Introduction to Unix & Linux.
Lecture 1: Introduction, Basic UNIX Advanced Programming Techniques.
Agenda The Bourne Shell – Part I Redirection ( >, >>,
+ Introduction to Unix Joey Azofeifa Dowell Lab Short Read Class Day 2 (Slides inspired by David Knox)
Learning Unix/Linux Based on slides from: Eric Bishop.
INTRODUCTION TO SHELL SCRIPTING By Byamukama Frank
Introduction to the Linux Command Line Interface Research Computing Systems Bob Torgerson July 19, 2016.
IT244 - Introduction to Linux / Unix Instructor: Bo Sheng
Overview of Linux Fall 2016 Dr. Donghyun Kim
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
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.
CSE 374 Programming Concepts & Tools
Tutorial of Unix Command & shell scriptS 5027
Basic UNIX OLC Training.
Tutorial of Unix Command & shell scriptS 5027
Introduction to Linux Week 0 - Thursday.
Tutorial of Unix Command & shell scriptS 5027
The Unix File System.
Chapter Four UNIX File Processing.
Andy Wang Object Oriented Programming in C++ COP 3330
Linux Shell Script Programming
CSE 303 Concepts and Tools for Software Development
Lab 2: Terminal Basics.
Introduction to Linux Commands
LPI Linux Certification
Presentation transcript:

Introduction to UNIX A User’s Perspective: Day 2 – Command Basics

Review – UNIX Shells The basics of UNIX Shells – Types ksh & bash – Initialization/configuration scripts /etc/profile &.profile /etc/bash_rc &.bash_rc

Review – File System Everything is a file Paths Ownership & Permissions

Let’s Log into the Server A few changes – The server we will use: spf1n5.ucc.uconn.edu – The login utility: ssh Why the changes?

Review - Commands ls – LiSt cd – Change Directory pwd – Present Working Directory rm – ReMove mkdir – Make Directory mv – MoVe cp – CoPy touch – Create cat – conCATenate echo – Hello…lloo..llooo… ln – Link chmod – Change permissions chown – Change Ownership Shortcuts to your home directory – cd – cd ~ – cd ~user-name – cd $HOME

Command Exercise 1. pwd 2. ls -al 3. touch index.html 4. ls –al 5. mkdir –p public_html/test/page 6. cp -p index.html public_html/test/page 7. mv index.html public_html/test 8. cd public_html 9. echo “name Loves UNIX” > test/index.html 10. cd echo “Mitch Loves UNIX” > test/page/index.html 12. ln –s test/index.html index.html 13. cat index.html 14. rm test/index.html 15. cat index.html 16. ln test/page/index.html test/index.html 17. cat index.html 18. echo “UNIX rules” >> test/page/index.html 19. cat index.html

What Did We Do?

Some Loose Ends CTRL-C – Terminate the current process CTRL-D – Close the connection immediately

What We Will Cover Today Extend our knowledge and use of commands Learn how to find help Standard I/O/E Redirection & Piping Customize our Shell account Begin to learn VI

Command Arguments Typically one or more file names the command will operate on

Switches!?! We don’t need no stink’in Switches Switches give us power/functionality Increase the functionality of a command Almost all commands have available switches Switches are denoted with a – (minus or hyphen)

Anatomy of a Command Command-name – Basic function Command-name arguments – Basic function performed on some file(s) Command-name –switches – Extended function Command-name –switches arguments – Extended function performed on some file(s)

Commands - Basic Function Single function ls, cp, mv, etc. – Minimal functionality – Minimal output

Commands – Directed Function Perform the command on a file – What can the file be? ls index.html rm /u/ux101is1/hdisk0

Commands – Extended Function Using switch(es) to refine the command output Usually provides more information Always deals with specific function of the base command

Commands – Directed Extended Function Refine the operation performed on a file(s) ls –ail index.html

Manual Pages – The UNIX Bible Everything you need to know… man pages – System resident manuals Available: – for most commands – on most UNIX systems – on the Web

Using man Syntax – man “command-name” – man –k “descriptor”

Anatomy of a man Page Purpose Syntax Description Details of switches Examples

Example cd ~ cd public_html ls –ailF cd test ls –ailF cd.. cp –h index.html.. cd.. ls –al rm index.html

What Should You Know? Basic Command Use How to use switches and arguments How to find help

Question? Anyone… anyone?

Redirection & Pipes Understanding UNIX Input and Output

What is Input? Information fed into a data processing system or computer (Merriam-Webster Dictionary) Data necessary to create some action or output. Text – ‘Joshua’ Keystroke combinations – CTRL -D

Input Sources Standard Input (stdin) Device – That part of the operating system controlling from where a program receives its input. – keyboard Any defined device capable of receiving input

What is Output? The information produced by a computer (Merriam-Webster Dictionary) Data created as a result of some action or input. Text – ‘Hello Joshua’ Pictures & Graphics –

Output Destinations Standard Output (stdout) Devices – That part of the operating system that controls where a program writes its output. – Monitor – Printer Any defined device capable of receiving output

Redirection Where? > the redirection operator – Allows for an output destination other then standard output (stdout). – Is a write only operation Can only redirect to regular files. # ls –al /usr > directory.lst

Pipes Keeping the Flow Going… | the pipe operator – Allows for the output (stdout) of one command to serve as the input (stdin) of another command – No write involved in the process Can only be used with commands ( executables ) # ls –al /usr/bin | grep ls

Putting it All Together What do we gain – Extended functionality – Increased control – Innovative solutions – An understanding of both input and output

IN CLASS DEMONSTRATION SIX Volunteers able to follow instructions – Hmmmm… A paper | B | C | D | E | F > Frontdesk

A Real World Example cp –p /u/ux101is1/tfile. ls –al tfile wc tfile sort tfile | wc sort tfile | uniq –c | wc sort tfile | uniq –c | sort –rn > tfile2 wc tfile wc tfile2 more tfile more tfile2

Running Processes Foreground – Ties up the command-prompt Loose control – Not really multi-tasking Background – Keep control of the command prompt Maintain control – Multi-tasking

What’s Running? ps –ef | grep ux ps aux | more ps –ef | grep “string”

Cron Jobs Scheduling jobs… – Minute Hour Day Month Day_of_the_Week Sunday = 0 * = Match all Examples: – 0,5,10,15,20,25,30,35,40,45,50,55 * * * * $HOME/automation.pl – 0 2 * * 4 /usr/sbin/acct/dodisk – 5 * * * * /usr/sbin/acct/ckpacct – 0 4 * * 1-6 /usr/sbin/acct/runacct 2>/var/adm/acct/nite/accterr

What Should You Know? – Basic Command Use – How to use switches and arguments – How to find help Understand Standard I/O/E Understand Redirection Understand Pipes How to use Redirection and Pipes Process management

Question? Anyone… anyone?

What Will Cover Tomorrow… Advanced UNIX commands VI

THANK YOU FOR ATTENDING Please fill out the Evaluation Form before leaving