UNIX From Capgemini

  • View
    221

  • Download
    0

Embed Size (px)

DESCRIPTION

unix for

Text of UNIX From Capgemini

  • UNIX Operating SystemLevel I

    The information contained in this presentation is proprietary.Copyright 2011 Capgemini. All rights reserved.*

    PurposeProvide understanding of UNIX operating system.Introduce various commands and shell scripting capability of UNIX.

    The information contained in this presentation is proprietary.Copyright 2011 Capgemini. All rights reserved.*

    ProductProper understanding of UNIX operating system architecture. Proper understanding of shell scripting abilities of UNIX.

    The information contained in this presentation is proprietary.Copyright 2011 Capgemini. All rights reserved.*

    ProcessExplain UNIX features.Hands on session.

    The information contained in this presentation is proprietary.Copyright 2011 Capgemini. All rights reserved.*

    AgendaUnderstanding unix.File systemCommands.Exercise & Assignment

  • Part IWhat is UNIX?

    The information contained in this presentation is proprietary.Copyright 2011 Capgemini. All rights reserved.*

    What is Unix?UNIX, in computer science, a powerful multi-user, multitasking operating system. Considered a very powerful operating system, UNIX is written in the C. Designed with Flexibility in mind.Designed with Modularity in mind.Everything is a file !

    The information contained in this presentation is proprietary.Copyright 2011 Capgemini. All rights reserved.*

    Structure

    The information contained in this presentation is proprietary.Copyright 2011 Capgemini. All rights reserved.*

    Processing modelCentralized

    The information contained in this presentation is proprietary.Copyright 2011 Capgemini. All rights reserved.*

    ComponentsKernelShell

    The information contained in this presentation is proprietary.Copyright 2011 Capgemini. All rights reserved.*

    ComponentsKernel Core of the UNIX system. Loaded at system start up (boot). Memory-resident control program. Manages the entire resources of the system, presenting them to you and every other user as a coherent system. Provides service to user applications such as device management, process scheduling, etc. Example functions performed by the kernel are: managing the machine's memory and allocating it to each process. scheduling the work done by the CPU so that the work of each user is carried out as efficiently as is possible. accomplishing the transfer of data from one part of the machine to another.interpreting and executing instructions from the shell.enforcing file access permissions.

    The information contained in this presentation is proprietary.Copyright 2011 Capgemini. All rights reserved.*

    ComponentsShell Whenever you login to a Unix system you are placed in a shell program. The shell's prompt is usually visible at the cursor's position on your screen. To get your work done, you enter commands at this prompt. The shell is a command interpreter; it takes each command and passes it to the operating system kernel to be acted upon. Several shells are usually available on any UNIX system, each with its own strengths and weaknesses. Different users may use different shells. Initially, your system administrator will supply a default shell, which can be overridden or changed. The most commonly available shells are: Bourne shell (sh) C shell (csh) Korn shell (ksh) Bourne Again Shell (bash) Each shell also includes its own programming language. Command files, called "shell scripts" are used to accomplish a series of tasks.

  • Part IILog in

    The information contained in this presentation is proprietary.Copyright 2011 Capgemini. All rights reserved.*

    Log inyou will need to have a valid username and a password Type your username at the login prompt UNIX is case sensitiveWhen the password prompt appears, type in your password. Your password is never displayed on the screen as a security measure.

    The information contained in this presentation is proprietary.Copyright 2011 Capgemini. All rights reserved.*

    Login screen

  • Part IIIWorking with Unix

    The information contained in this presentation is proprietary.Copyright 2011 Capgemini. All rights reserved.*

    General commands date - show date and time whoami - show your userid who - show who is logged onto the system w - show who is logged onto the system pwd - print the working directory's name clear - clear the screen finger The finger command displays information about users on a given host. The host can be either local or remote. finger your userid

    The information contained in this presentation is proprietary.Copyright 2011 Capgemini. All rights reserved.*

    General commandsls -a - list all files in current directory ls -al - long list of current directory cat .bashrc - display contents of .bashrc file mkdir dir1 - make a directory called dir1 cd dir1 - change directory to dir1 cd .. - change to parent directory rmdir dir1 - remove directory dir1 cp .login new.login - copy the .login file to new.login wc new.login - count the lines, words and characters in the new.login file wc -l new.login - count just the lines rm new.login - remove the new.login file

    The information contained in this presentation is proprietary.Copyright 2011 Capgemini. All rights reserved.*

    Changing your password passwd Old password: - enter your current password New password: - enter your new password Retype new password: - re-enter your new password

    The information contained in this presentation is proprietary.Copyright 2011 Capgemini. All rights reserved.*

    Logging Off The System To logout enter the command logout or exit.If this does not, work press Ctrl-d. If you have a .logout file in your home directory, the system will execute any commands contained there.

  • Part IVFile system

    The information contained in this presentation is proprietary.Copyright 2011 Capgemini. All rights reserved.*

    Features of UNIX File systemAll of the files in the UNIX file system are organized into a multi-leveled hierarchy called a directory tree. A family tree is an example of a hierarchical structure that represents how the UNIX file system is organized. The UNIX file system might also be envisioned as an inverted tree or the root system of plant. At the very top of the file system is single directory called "root" which is represented by a / (slash). All other files are "descendents" of root. The number of levels is largely arbitrary, although most UNIX systems share some organizational similarities.

    The information contained in this presentation is proprietary.Copyright 2011 Capgemini. All rights reserved.*

    File typesOrdinary Files DirectorySpecial Files Pipes

    The information contained in this presentation is proprietary.Copyright 2011 Capgemini. All rights reserved.*

    File typesOrdinary Files Used to store your information, such as some text you have written or an image you have drawn. This is the type of file that you usually work with. Always located within/under a directory file Do not contain other files

    The information contained in this presentation is proprietary.Copyright 2011 Capgemini. All rights reserved.*

    File typesDirectories Branching points in the hierarchical tree Used to organize groups of files May contain ordinary files, special files or other directories Never contain "real" information which you would work with (such as text). Basically, just used for organizing files. All files are descendants of the root directory, ( named / ) located at the top of the tree.

    The information contained in this presentation is proprietary.Copyright 2011 Capgemini. All rights reserved.*

    File typesSpecial Files Used to represent a real physical device such as a printer, tape drive or terminal, used for Input/Ouput (I/O) operations Unix considers any device attached to the system to be a file - including your terminal: By default, a command treats your terminal as the standard input file (stdin) from which to read its input Your terminal is also treated as the standard output file (stdout) to which a command's output is sent Stdin and stdoutTwo types of I/O: character and block Usually only found under directories named /dev

    The information contained in this presentation is proprietary.Copyright 2011 Capgemini. All rights reserved.*

    File typesPipes UNIX allows you to link commands together using a pipe. The pipe acts a temporary file which only exists to hold data from one command until it is read by another

    The information contained in this presentation is proprietary.Copyright 2011 Capgemini. All rights reserved.*

    File Types

    File typeMeaning-a normal file da directory lsymbolic link bblock device file ccharacter device file pa fifo or named pipe

    The information contained in this presentation is proprietary.Copyright 2011 Capgemini. All rights reserved.*

    File Names UNIX permits file names to use most characters, but avoid spaces, tabs and characters that have a special meaning to the shell, such as: & ; ( ) | ? \ ' " ` [ ] { } < > $ - ! / Case Sensitivity: uppercase and lowercase are not the same! These are three different files: NOVEMBER November november Length: can be up to 256 characters Extensions: may be used to identify types of files libc.a - archive, library file program.c - C language source file alpha2.f - Fortran source file xwd2ps.o - Object/executable code mygames.Z - Compressed file

    The information contained in this presentation is proprietary.Copyright 2011 Capgemini. All rights reserved.*

    File NamesHidden Files: have names that begin with a dot (.) For example: .cshrc .login .mailrc .mwmrc Uniqueness: as children in a family, no two files with the same parent directory can have the same name. Files located in separate directories can have identical names. Reserved Filenames: / - the root directory (slash) . - current directory (pe