Agenda Introduction Administrative Announcements Link of the Week Expected Outcomes This Week’s Topics Next Week’s Lab Assignment Break Out Problems Upcoming.

Slides:



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

Chapter One The Essence of UNIX.
NETW-240 Shells Last Update Copyright Kenneth M. Chipps Ph.D. 1.
Cosc 4750 Getting Started in UNIX Don’t be afraid of the prompt, in linux it can be your best friend. In some cases, the only way to do certain things.
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.
Linux+ Guide to Linux Certification, Second Edition
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
Guide To UNIX Using Linux Third Edition
Lecture 02CS311 – Operating Systems 1 1 CS311 – Lecture 02 Outline UNIX/Linux features – Redirection – pipes – Terminating a command – Running program.
7/17/2009 rwjBROOKDALE COMMUNITY COLLEGE1 Unix Comp-145 C HAPTER 2.
Week Two Agenda Announcements Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Next lab assignments.
Sydney Opera House. Week Three Agenda Administrative Issues Link of the week Review week two lab assignment This week’s expected outcomes Next lab assignment.
Help session: Unix basics Keith 9/9/2011. Login in Unix lab  User name: ug0xx Password: ece321 (initial)  The password will not be displayed on the.
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.
Linux environment ● Graphical interface – X-window + window manager ● Text interface – terminal + shell.
Introduction to Shell Script Programming
Agenda User Profile File (.profile) –Keyword Shell Variables Linux (Unix) filters –Purpose –Commands: grep, sort, awk cut, tr, wc, spell.
Chapter Four UNIX File Processing. 2 Lesson A Extracting Information from Files.
Guide To UNIX Using Linux Fourth Edition
Week Three Agenda Administrative Issues Link of the Week Review Week Two Information This Week’s Expected Outcomes Next Lab Assignment Break-Out Problems.
Introduction to Unix – CS 21 Lecture 9. Lecture Overview Shell description Shell choices History Aliases Topic review.
Week Two Agenda Announcements Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Next lab assignments.
Week Two Agenda Announcements Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Next lab assignments.
UNIX and Shell Programming (06CS36) Unit 1 Continued… Shrinivas R. Mangalwede Department of Computer Science and Engineering K.L.S. Gogte Institute of.
The Shell Chapter 7. Overview The Command Line Standard IO Redirection Pipes Running a Program in the Background Killing (a process!)
CS 390 Unix Programming Summer Unix Programming - CS 3902 Course Details Online Information Please check.
Guide to Linux Installation and Administration, 2e1 Chapter 7 The Role of the System Administrator.
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 programming 1. INDEX UNIT-III PPT SLIDES Srl. No. Module as per Session planner Lecture No. PPT Slide No. 1.Problem solving approaches in Unix,Using.
Agenda Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Review next lab assignments Break Out Problems.
Lesson 2-Touring Essential Programs. Overview Development of UNIX and Linux. Commands to execute utilities. Communicating instructions to the shell. Navigating.
Week Two Agenda Announcements Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Next lab assignments.
Week Two Agenda Announcements Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Next lab assignments.
Week Two Agenda Announcements Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Next lab assignments.
Week Three Agenda Administrative Issues Link of the Week Review Week Two Information This Week’s Expected Outcomes Next Lab Assignment Break-Out Problems.
Introduction to Programming Using C An Introduction to Operating Systems.
Sydney Opera House. Week Three Agenda Administrative Issues Link of the week Use of the Virtual Machine Review week two lab assignment This week’s expected.
Chapter Six Introduction to Shell Script Programming.
Week Three Agenda Administrative Issues Link of the week Review week two lab assignment This week’s expected outcomes Next lab assignment Upcoming deadlines.
Week Two Agenda Announcements Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Next lab assignments.
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.
Week Three Agenda Administrative Issues Link of the Week Review Week Two Information This Week’s Expected Outcomes Next Lab Assignment Break-Out Problems.
Sydney Opera House. Week Three Agenda Administrative Issues Link of the week Use of the Virtual Machine Review week two lab assignment This week’s expected.
Agenda Introduction Administrative Announcements Link of the Week Expected Outcomes This Week’s Topics Next Week’s Lab Assignment Break Out Problems Upcoming.
CS 245 – Part 1 Using Operating Systems and Networks for Programmers Jiang Guo Dept. of Computer Science California State University Los Angeles.
1 CS3695 – Network Vulnerability Assessment & Risk Mitigation – Introduction to Unix & Linux.
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.
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.
Week Two Agenda Announcements Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Next lab assignments.
Week Two Agenda Announcements Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Next lab assignments.
Week Two Agenda Announcements Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Next lab assignments.
Week Two Agenda Announcements Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Next lab assignments.
Tutorial of Unix Command & shell scriptS 5027
Week Two Agenda Announcements Link of the week Use of Virtual Machine
Linux Commands Help HANDS ON TRAINING Author: Muhammad Laique
Week Three Agenda Link of the Week Review Week Two Information
C151 Multi-User Operating Systems
Sydney Opera House.
Chapter 2: System Structures
Unix Operating System (Week Two)
INTRODUCTION TO UNIX: The Shell Command Interface
Tutorial of Unix Command & shell scriptS 5027
Tutorial of Unix Command & shell scriptS 5027
Week Three Agenda Link of the Week Review Week Two Information
Tutorial of Unix Command & shell scriptS 5027
Chapter Four UNIX File Processing.
Linux Shell Script Programming
Presentation transcript:

Agenda Introduction Administrative Announcements Link of the Week Expected Outcomes This Week’s Topics Next Week’s Lab Assignment Break Out Problems Upcoming Deadlines Lab assistance, questions, and chat time

Link of the week The link below lists most all operating systems that are available. The link below has tabs for books, posters, software, and tools Definition of Operating System (OS) Common operating systems discussed in this class will be: UNIX, Linux, HP-UX, and Windows Basic tasks performed by an operating system ◦ Control and allocate memory for processes ◦ Prioritize system requests for the CPU ◦ Control input and output transmissions to and from devices ◦ Facilitate networking and support file system management

Link of the week Services Operating System (OS) perform ◦ Process management ◦ Memory management OS coordinates various types of memory ◦ File systems ◦ Networking ◦ Graphical user interface (GUI) and command line ◦ Device drivers ◦ Security  Internal management  External management

Link of the week Services Operating System (OS) perform Process management – Background and foreground processes Memory management - The essential requirement of memory management is to provide ways to dynamically allocate portions of memory to programs at their request, and freeing it for reuse when no longer needed. This is critical to the computer system. Random Access Memory (RAM) – Static and dynamic RAM. Cache Memory - is a cache used by the central processing unit of a computer to reduce the average time to access memory Shared Memory - The essential requirement of memory management is to provide ways to dynamically allocate portions of memory to programs at their request, and freeing it for reuse when no longer needed. This is critical to the computer system.

Link of the week File systems - Is an abstraction to store, retrieve and update a set of files. The term identifies data structures specified by some of those abstractions, which are designed to organize multiple files as a single stream of bytes. Network protocols are specified by other abstractions, which are designed to allow files on a system to be accessed remotely. Networking – Internal and external communication. Graphical user interface (GUI) and Command line (CLI). Device drivers - Is a computer program that operates or controls a particular type of device that is attached to a computer. A driver typically communicates with the device through the computer bus or communications subsystem to which the hardware connects

Link of the week Security Internal management and external management. Internal security pertains to employees inside the company and visitors that come to a company to sale products, repair equipment and delivery persons. External security encompasses users needing access to company data and/or assets. The list of external users accessing data for a company could be significant depending on the nature of the business. The list includes employees working remotely, branches offices, and company suppliers.

Course expected outcome Upon successful completion of this module, the student will be able to: Create scripts using shell variables and program control flow. Use man page system and find script tools. Use redirection and pipes to combine scripts and executables.

VI Text Editor Features of the text editor “vi” Vi was the first full screen text editor written for UNIX. It was initially designed to be simple and small in size. The designers intended vi to fit on a floppy-based emergency boot system. For this specific reason, you may need to use it in an emergency recovery situation. Most Linux distributions ship with a variant of vi known as Vim. Vim has been enhanced, supporting more features than the original vi editor. You will find that most distributions of Vim support launching it by typing vi, as if it were the original vi.

VI Text Editor Vi is made up of three modes, executing in one of the three modes: The command mode accepts commands, which are usually single characters. For example, o and O and I and an all enter the insert mode, but in different ways. The O and o open a line above and below, respectively where the cursor is positioned. The Ex mode is entered for saving your file. This is initiated by typing a colon (:), followed by entering a w or q character to save or not to retain the information in the file. After executing in the ex-mode, vi automatically returns to the command mode. The Insert mode allows you to enter text that appears on the terminal. To exit the insert mode, depress the Esc key, which will return you to the command mode.

VI Text Editor Basic vi commands Save text file - :wq! Delete a character – x Inserts a new line immediately below the current line - o Inserts a new line immediately above the current line – O Undo any changes – u Change current word – cw Move around in file using the line number - G Insert information on left side of a character – i Insert information on right side of a character – a Delete a line in a file – dd

UNIX Environment Executing your environment The behavior of shell commands are determined by the execution of the environment provided by the shell. The UNIX shell maintains a complete set of environment variables that provide information about different areas of the operating system. For example, there are variables for the terminal type, current working directory, and default file and directory permissions. The environment variables are passed to all scripts and programs that are not built in to the shell, but may be accessed or modified, by the program. The convention for specifying environment variables is in upper casr letters.

UNIX Environment To view all environment variables, type printenv To view a particular environment variable, type echo $EDITOR The above command echos the value of the $EDITOR environment variable

HP-UX Executing Environment When you log in to a system, the sequence of events can differ when creating your working environment. The particular sequence of events depends on the flavor of UNIX being implemented and the default shell for your account. The HP-UX operating system subscribes to the following sequence of events at log in: The getty process provides the login: prompt seen on your terminal. The getty process reads the provided username, and invokes the login program.

HP-UX Executing Environment The login program receives the username from the getty process, and prompts the user for their password. The login program consults the /etc/passwd file to verify your password. On most UNIX-like systems, the /etc/passwd file provides an “X” in the password field that directs verification to the /etc/shadow file. The login program turns off terminal echo so that the password characters are not displayed on the terminal. After the password has been authenticated, the default shell is invoked by accessing the information in the last field /etc/passwd file for that username.

HP-UX Executing Environment When the shell program starts, it reads the configuration files called login scripts to configure the execution environment. On HP-UX, the /etc/profile file contains initialization parameters for ksh and sh, while the /etc/csh.login file is used for csh. After the system login scripts have been read, the shell looks for user- specific login scripts. After the system login scripts have been read, the shell reads user login scripts. The user login scripts are stored in the user’s home directory, where a user can customize their shell environment. The sh and ksh shells look in the.profile. Ksh reads a file defined in the environment variable ENV. Csh reads a file called.cshrc, and if it is the login shell, the file.login.

System Environment Variables TERM – is an environment variable defines the type of terminal being used. PATH – is an environment variable that contains the snip- it of directories to be searched for programs that correspond to command names. When a command name is entered to a shell, the PATH variable is searched sequentially through each directory until it finds an executable script or program with that command name typed. USER – contains the username. When a file or directories are accessed, the access permissions are verified against the value found in the USER variable. HOME – is an environment variable that contains your home directory.

HP-UX Executing Environment MAIL – is the environment variable that contains the name of the directory where your incoming mail is stored. EDITOR – is the environment variable used by programs that invoke text editors? HOST – is an environment variable that contains the name of the host machine that is executing your shell program. When connecting to another remote machine through telnet or ftp, the name of the host is transferred to the remote machine, and displayed on the remote terminal so the administrator can know the names of the systems he or she is logged into.

Processes and Tasks General approach to foreground and background processes When you log in to a UNIX system, the kernel starts a specific shell for you, and connects your shell to your terminal. When a command is entered and executed from the shell, the shell creates a child process to execute the command, and connects the child process to your terminal. By connecting the child process to your terminal, the shell allows you to communicate send input to the child process, and receive output from it. When the child process finishes, all resources are relinquished to the system, your shell regains access to the terminal, redisplays the shell prompt, and waits for your next command.

Processes and Tasks Processes that requires user to be actively participants (like processing Excel) must execute in the foreground in order to run. These jobs are termed "interactive," and must periodically update the display monitor, and accept input from the user, and allow access to the terminal interface. There are processes that do not require active participation once they are started. For example, a subroutine that initially accepts input data like a pattern and data file from the main script, uses the pattern to find a match in the data file, and writes matched information to an output file. Non- interactive jobs do not accept input commands, display output data on your terminal, and are disconnected from your terminal, and releasing the terminal for interactive use. This type of process is referred to as a “background” process.

Processes and Tasks It is possible to log out of a system, and leave the background processes executing. The down side of this action is not being able to reconnect a background process to a terminal after logging out. If the background process identification information (PID) is known, the process can be terminated from a terminal. The number of background processes executing at the same time can be many, where a foreground process can only execute one process at a time. The reason is because you only have one terminal for viewing and one keyboard at your terminal.

Conceptual Appearance of UNIX

UNIX File Types Command: ls -l drwxrwxrwx permissions (Directory) -rwxrwxrwx permissions (File) lrwxrwxrwx permissions (Symbolic link) -rwx dandrear faculty (Hard link) crw root root audio (Character device) brw-rw root disk aztcd (Block device)

UNIX Operating System Pipe Command Users can connect the standard output of one command into the standard input of another command by using the pipeline operator (|). Demonstrate command usage: ps -ef ps –ef | wc –l ps –ef | awk ‘{print $2}’ ps –ef | grep dandrear ls –l | cut –c1-3 who –b (Time of last system boot) who –r (Print current run level) who –s (Print short version of user on system)

UNIX Operating System File Descriptor A process associates a number with each file it as open. This number is called a file descriptor. When you log in, your first process has the following three open files connected to your terminal. Standard input: File descriptor 0 is open for reading. Standard output: File descriptor 1 is open for writing. Standard error: File descriptor 2 is open reading.

UNIX Operating System Manual (man) Command Linux command documentation is known as “man”. Each page is a self-contained document. The Manual sections are split into eight numbered sections: 1 General commands. 2 System calls 3 C library functions 4 Special files (usually devices, those found in /dev) and drivers. 5 File formats and conventions 6 Games and screensavers 7 Miscellaneous 8 System administration commands and daemons

UNIX Operating System Grep Command The grep command searches the named input file(s) for lines in a file containing a given pattern. When a pattern is found, each line is reported to standard output. Demonstrate: grep [options] pattern file(s) grep inc_A ~dandrear/xyz grep inc_A prog1 prog2 grep inc_A *

UNIX Operating System Find Command The find command lists all pathnames that are in each of the given directories. Demonstrate: find ~dandrear –type d –print find ~dandrear –type f -print find. –print find / -type f –print

UNIX Operating System Redirections Many UNIX commands take text-like input and produce text-like output. It's sometimes useful to be able to control where the input comes from and output goes (via redirection), or even pass the output from one command to another's input (via pipes).

UNIX Operating System Redirection (cont) Redirect the standard output of a command to a file. date > /tmp/date_saved Redirect the standard input of a command so that it reads from a file instead of from your terminal. cat < ~dandrear/Fall_2013_Solutions/foobar Append the standard output of a command to a file. cat foobar_2 >> foobar_1

Conceptual Appearance of UNIX Command: ls –l drwxrwxrwx permissions (Directory) -rwxrwxrwx permissions (File) lrwxrwxrwx permissions (Symbolic link) -rwx dandrear faculty (Hard link) crw root root audio (Character device) brw-rw root disk aztcd (Block device)

UNIX Operating System Moving Around in UNIX ls –a ps –ef whoami rmdir touch less w tail head sort man

Break-out Problems 1. ps | wc –l 2. who | awk ‘{print $1}‘ | sort –u | wc –l 3. ps –ef | awk ‘{print $1}’ | sort –u | wc –l 4. sort –r names.txt 5. ps –ef | awk ‘{print $8, $1}’ 6. find /bin -name gzip 7. find /etc -name motd 8. > newfile 9. rm file_name 10. date | cut –c cp test_data.txt ~dandrea/temp 12. mv test_data.txt ~dandrear/temp 13. printf $NUMBER 14. touch newfile

Hands-On-Information Lab Assignment 2-1, Simple Shell Scripting, due January 20, Lab Assignment 3-1, Advanced Scripting, due January 27, Read Chapters 1 and 2 in Essential System Administration text. Read Module Two listed under the course Web site. Everyone should have received a Shell Quick Reference document and script logic for Lab Assignment 2-1.

After Class Assistance Questions? Comments? Concerns? After each Franklin Live session, I will remain on the session to provide assistance unless otherwise indicated.

Lab assistance, questions, and chat time