Unix Environments: Core Concepts and Design Principles

introduction to unix environment n.w
1 / 19
Embed
Share

Explore the big picture of Unix environments, including the kernel vs. shell, file structures, permissions, and scripting. Learn about Unix's origins, core features, and communication methods with the kernel. Discover the role of shells, daemons, and common Unix commands.

  • Unix Environments
  • Kernel
  • Shell
  • Scripting
  • Daemons

Uploaded on | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. Introduction to Unix Environment What we learn this time: Big figure of Unix environments Basic concepts and design principles of Unix kernel vs. shell File structures, naming, permissions Scripting Reading Chapters 1, 2, 4, and 5

  2. What about Unix Who wrote Unix and where? Ken Thompson and Dennis Ritchie (ACM Turing Award, 1983) AT&T Bell Labs Features Simple and elegant design Extensible multi-user programming environment Shared file system Easy to build and share programs Interface is minimal, but allows programs to be strung together the power of a system comes from the relationships among programs than from the programs themselves 2

  3. Unix Core The core of the Unix OS is called the kernel Kernel is the main program or the heart Manage/schedule computer resources Assigns memory to programs running Partitions CPU time fairly Handles the I/O, etc. Unix is a multi-user OS Variety of Unix flavors: Linux, FreeBSD, Solaris, Mac OS X 3

  4. Unix Most functionality is the same between implementation For example, they all have commands vi, cd, man Built-in commands and utilities behavior might differ FreeBSD make vs. GNU make POSIX (Portable Operating System Interface) IEEE standard that tries to work toward apps interoperability 4

  5. Communication with Unix A user never talks directly to a kernel Three programs used to communicate with kernel shell a command interpreter GUI implemented with a set of running programs Interactive command runs inside a tty (teletype) and reads your typing Text editor (such as vi) What do these programs use to talk to kernel? System calls 5

  6. Shells What is a shell? A command interpreter A shell is just a program, not part of kernel Many shells sh csh ksh tcsh bash 6

  7. Daemons Many daemon programs running in Unix Long-running programs Group of helper programs Help the system with mail, network communication, tracking time, etc 7

  8. A Few Commands Command shutdown Use this command to turn off a machine to ensure that all processes are properly shut down before the machine is turned off. Command fsck When a system starts, it will run fsck to check and optionally repair file system (should the machine is not turned off properly) 8

  9. Hierarchical File System 9

  10. Home directory /home/username your own place Could be different on different systems Store any file you like You can go back to your home directory by cd (without any parameter) cd ~ (tilde) Or cd ~yourusername Of course, you can also go back step by step (directory by directory), or using absolute path 10

  11. Pathnames Locate files Current directory currently working directory Absolute vs. relative paths pwd vs. cd Current directory: . Parent directory: .. Your home directory: ~ username s home directory ~username 11

  12. Unix Filenames Filenames can be made up of any character set except a slash ( / ) and null character Case sensitive Periods are used by some programs to separate filenames from file extensions Filenames beginning with a dot (.) are treated differently by the shells Microsoft files are filename.extension Unix has no specific rules about file extensions Some programs such as the C compiler will look for file extensions 12

  13. Filename Wildcards ? matches any single character * - matches any characters (can be zero length) [character-list] Matches any single character in the list filename.[character-set] E.g. filename.[0123456789], matches files filename.n Another way is filename.[0-9] One exception slash (/), no matches can be made against it One note Wildcards are interpreted by shell before passing to the command typed by user For example, ls * Type echo ls * in a shell 13

  14. File Permissions Owner, group, and other When a file is first created, its owner is the user who created the file, and the primary group in which he belongs to. UID user ID Every user belongs to a group groups, id chgrp change group chown change owner chmod change permissions on file(s) Options u/g/o: $ chmod u+x filename Three digits xxx: $ chmod 700 filename 14

  15. Superuser (root) Do we need to say more? We always need someone to handle some special things, and when something happens, we also need someone to take care of it. You can log in as root (if you are) Or, using the command su Also check command sudo 15

  16. Unix Files Unix is file oriented Everything is treated as a file File is a stream of bytes with no special structure, but it could be defined by the programs that use it Files use linefeed character instead of carriage return to end a line 16

  17. Scripting Languages Scripting languages and applications differ from compiled languages, but how? Interpreted as run Perl Practical Extraction and Report Language Created by Larry Wall Python More structured More object-oriented and data-manipulation features Tcl Simpler to learn and use. Graphic user interface library tk 17

  18. Some Unix Commands pwd Print current working directory ls List content (files) under a directory cd Change directory (go to some directory) rm Delete a directory or file mkdir Create a new directory 18

  19. Reading Assignment Chapter 2 19

More Related Content