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.

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.
Linux+ Guide to Linux Certification, Second Edition
23-Jun-15Advanced Programming Spring 2002 bash Henning Schulzrinne Department of Computer Science Columbia University.
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.
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.
Introduction to Linux/UNIX. History UNIX beginnings in 1969 (Linus Torvalds is born!) AT & T Bell Laboratories (Ken Thompson & Dennis Richie) Working.
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.
Shell - Introduction & Commands Chapter III / Part II.
Welcome to CSE  Name: Di Cao   Classroom: DL357  Class Time: T 8:30am - 9:18am  Office.
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”
UNIX command line. In this module you will learn: What is the computer shell What is the command line interface (or Terminal) What is the filesystem tree.
Week 7 Working with the BASH Shell. Objectives  Redirect the input and output of a command  Identify and manipulate common shell environment variables.
Guide To UNIX Using Linux Fourth Edition
Introduction to Computer Organization & Systems Topics: Intro to UNIX COMP John Barr.
The UNIX Shell. The Shell Program that constantly runs at terminal after a user has logged in. Prompts the user and waits for user input. Interprets command.
Shells. A program that is an interface between a user at a terminal and the computers resouces ▫The terminal may be real or an emulator The shell is.
CS 6560 Operating System Design Lecture 3:Tour of GNU/Linux.
1 UNIX essentials (hands-on) the directory tree running programs the shell → command line processing → special characters → command types → shell variables.
Session 2 Wharton Summer Tech Camp Basic Unix. Agenda Cover basic UNIX commands and useful functions.
UNIX/LINUX Shells Shell is an UNIX/LINUX command interpreter. Shell command can be internal or external. The code to execute an internal command is part.
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.
Linux+ Guide to Linux Certification Chapter Eight Working with the BASH Shell.
Lesson 2 1.Commands 2.Filename Substitution 3.I/O Redirection 4.Command Grouping 5.Shell Responisibilites Review of the Basics.
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 An Introduction. Brief History UNIX UNIX Created at Bell Labs, 1969 Created at Bell Labs, 1969 BSD during mid 70s BSD during mid 70s AT&T began offering.
UNIX shell environments CS 2204 Class meeting 6 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
UNIX shell environments CS 2204 Class meeting 4 Created by Doug Bowman, 2001 Modified by Mir Farooq Ali, 2002.
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.
Linux Commands C151 Multi-User Operating Systems.
Module 1 - Introduction to Linux. Users must log-in Linux is case sensitive File and Directories naming conventions (No spaces!) Files and Directories.
Lecture 02 File and File system. Topics Describe the layout of a Linux file system Display and set paths Describe the most important files, including.
Linux+ Guide to Linux Certification, Second Edition
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 ( >, >>,
Lesson 8-Specifying Instructions to the Shell. Overview An overview of shell. Execution of commands in a shell. Shell command-line expansion. Customizing.
Learning Unix/Linux Based on slides from: Eric Bishop.
Linux Administration Working with the BASH Shell.
INTRODUCTION TO SHELL SCRIPTING By Byamukama Frank
Implementation of a simple shell, xssh
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.
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
UNIX Introduction History Main Features UNIX Operating System
Implementation of a simple shell, xssh
System Programming and administration CS 308
Some Linux Commands.
C151 Multi-User Operating Systems
John Carelli, Instructor Kutztown University
Unix : Introduction and Commands
Introduction to Linux/UNIX
Introduction to Computer Organization & Systems
Introduction Paul Flynn
Linux Shell Script Programming
Chapter 3 The UNIX Shells
Introduction to Linux Commands
A shell is a user interface.
LPI Linux Certification
Presentation transcript:

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 interpret lists of commands entered by the user, or read cmds from a file (known as a script). –A prompt is displayed by the shell program indicating it is ready to accept input from the user.

Shell Types Bourne Shell (ALGOL syntax) –sh, –bash –ksh –zsh C-shell (based on C language syntax) –csh –tcsh

Unix/Linux Commands commandName options files man commandName –to read about the command Example: man find

accounts Root –Has absolute control over the OS Regular –User login id number, string, and password.

Shell Startup The.bash_profile (in place of the.profile) and.bashrc are used at TU. Ubuntu,.bashrc

Linux Files Everything in the OS is organized into files. There is a i-node for every file on the file system (i = information)

Files Regular files includes (aka ordinary) –executable (*) and –hidden files (.). Special files: –Symbolic link –Directory (d) –Others: block special, named pipe, character special Use the cmd: file filename Use the ls command.

The File System Navigate with cd, pwd, ls Organized by directories –mkdir, rmdir –cp, mv, rm / is known as root /boot /home /var /tmp

Directory Pathnames Absolute – always begins with root /. Relative – does not begin with root./aFile bFile /home/user/cFile../data/dFile

File names See pg characters, no / allowed.

ls –l Type-user-group-other -rwxr-xr— Token 1 Token 2-4 Token 5-7 Token 8-10 Access control is through the chmod cmd.

chmod Octal: –chmod [ugo]+|-[rwx] –Octal r=4, w=2, x=1, the complement of umask –X is required for a script to run (pg 29) Examples

The Shell Env Variables –Local are only visible in the current process. –Environment variables are inherited by sub- processes, Example: PATH –PATH is used by the shell to find commands entered by the user. export PATH=$PATH:.:~/bin echo $PATH

Input and Output STDIN = 0 the standard input STDOUT = 1 the standard output STDERR = 2 the standard error Most cmds are designed to display output to the stdout Many cmds are designed to read input from the stdin. Error messages go to stderr.

Input & Output The default location for output is the terminal screen. It is possible to redirect the output of a command to: –Another command using a pipe | –A file using the output redirect symbol > Example: date > aFile ps | wc –l

Input & Output It is possible to control the input to a command The read command is designed to capture input from the standard input: cat file >Steve >stop greeting < file echo “What is your name?” read Name echo “Greetings $Name”

Processes Init is process id # 1 Dummy processes during system startup do not have a process ID. All other processes have a process ID.

Example Use ps and sleep to introduce background processes using the & ps will show processes running on a system. A process can be stopped (killed) by using the PID. kill pid

Substitution (Meta Characters) *, ?, [range] !, ^, $