790 likes | 963 Views
Introduction to UNIX. Eric Paules. Outline. History of UNIX Features, components and capabilities Accessing a system (logging in) System configuration files Useful commands User Accounts Passwords. History of UNIX.
E N D
Introduction to UNIX Eric Paules
Outline • History of UNIX • Features, components and capabilities • Accessing a system (logging in) • System configuration files • Useful commands • User Accounts • Passwords
History of UNIX • The UNIX operating system was originally developed at AT&T Bell Labs in 1969. • Source code distributed to universities. • As a result, several versions of UNIX developed over time.
History of UNIX • In 1979, AT&T announced they wanted to charge for Unix licenses. Their version known as System V. • University of California at Berkeley created its own variant, BSD Unix. • Many early commercial versions (like SunOS) were based on BSD.
History of UNIX • In 1987, Sun and AT&T began work on creating a type of industry standard for UNIX. • Effort to combine the best features of AT&T’s System V and BSD’s Release 4. • Enabled software to be developed for UNIX without concern as to version.
History of UNIX • In 1990, System V Release 4 (SVR4) was released. • Became the basis for • Sun Microsystems’ Solaris • AT&T UNIX • IBM's AIX • Hewlett-Packard's HP-UX
History of UNIX • Linux • Linus Torvalds began developing the Linux kernel in 1991. • Version 1.0 released 1994. • Since then Linux development has escalated due to its open source nature. • Distributions: Red Hat, Caldera, SUSE, etc.
History of UNIX • Several BSD variants still popular • FreeBSD • OpenBSD • NetBSD • Latest arrivals to the UNIX world • BeOS • Apple Mac OS X
Popular Uses of UNIX • Servers • Web, Application, Database, File/FTP • DNS (Domain Name System) • E-mail (sendmail), Directories (NIS, LDAP) • Workstations • Scientific, engineering, simulation, financial, graphics and imaging applications
Popular Uses Example • UNIX as a Web Server Platform • UNIX/Apache is the platform behind 62% of Internet web servers. • Microsoft OSs behind 22% of web servers. • Other 16% (which includes some other web servers, such as iPlanet, on UNIX) • Source: www.netcraft.com
Why? • UNIX is a very mature operating system • Over 30 years of development and improvement • Considered to be very stable • Not uncommon to find a UNIX system running for several months w/out reboot • Performance • Efficient, can do more with less hardware
UNIX Operating System Features • Multitasking • Multi-user • Protected Memory • Distributed Processing • Scalable • Portable • Security
Multitasking • Enables more than one tool or application to be used at one time. • Enables the kernel to track several processes simultaneously.
Multi-user • Enables more than one user to interactively access the same system resources. • This is different from multiple users accessing a document on a central file server; that type of use is considered passive (local system is doing the processing, not the server).
Protected Memory • Each process runs in its own exclusive memory space. • If one process crashes, it is unlikely to impact other running processes.
Distributed Processing • Enables the use of resources across a network. • Multiple UNIX systems can cooperate on processing a job.
Scalable • UNIX can accommodate more than one CPU. • Maximum number varies by distribution. • Symmetric multiprocessing (SMP) distributes processes across different CPUs.
Portable • Versions of UNIX can be compiled to run on different types of CPUs. • Intel/AMD/Cyrix • Sun Sparc • IBM/Motorola PowerPC • DEC Alpha
Security • UNIX contains a number of security features. • Account and password required to access a system. • Owner and group permissions on files and directories. • Users restricted from modifying system parameters.
Operating System • A set of programs that manages all computer operations and provides a link between the user and system resources. • Converts requests that come from the mouse and/or keyboard into computer operations.
Components of theUNIX Operating System • Kernel • Shell • File System
Kernel • Master program (core) of the UNIX operating system. • Manages devices, memory, swap space (virtual memory), user processes and daemons (system processes). • Also controls the functions between the system programs and the system hardware.
Shell • Interface between the user and the kernel. • Acts as an interpreter or translator. • Accepts commands issued by the user, interprets what the user types, and requests execution of the programs specified. • Execution is performed by the kernel.
Shell • Three common shells can be found in a UNIX environment • Bourne shell (indicated by the $ prompt) Often the default shell; no aliasing or history capabilities. • Korn shell (indicated by the $ prompt) A superset of Bourne with aliasing and history. • C shell (indicated by the % prompt) Also has aliasing and history; C-like syntax.
File System • A hierarchy of directories, subdirectories, and files that are usually organized or grouped together for a specific purpose. • UNIX uses UFS, the Unix File System. • Sun developed NFS, the Network File System, for systems to access data stored on other systems.
User Interfaces • Primary: Command Line • Various shells • Secondary: GUI, X-Windows protocol • OpenWindows • CDE (Common Desktop Environment) • KDE (open source version of CDE) • Gnome
File Structure • A hierarchy of directories, subdirectories, and files that are usually organized or grouped together for a specific purpose. • Data are organized in the file system's hierarchical structure of directories in a way similar to how information is stored in a file cabinet.
Directory Terminology • Root directory • The topmost directory in the file system hierarchy. • Required for the operating system to function and contains critical system files (such as the kernel).
Directory Terminology • Subdirectory • Any directory below another directory. • Parent Directory • The directory immediately above a subdirectory. Each subdirectory has only one parent, although a parent directory can have many subdirectories.
Directory Terminology • Pathname – uniquely identifies a particular file or directory by specifying its location. • Pathnames in UNIX use forward slashes (/) as the delimiter between object names. • Example: /home/jsmith/file.txt
Directory Terminology • Root / • Top level of the file system. • Current Directory . • The directory you are in. • Parent Directory .. • The directory above the one you are in. • Home Directory ~ • User’s default login directory (ksh and csh).
Directory Terminology • Absolute Pathname • Path to a file or directory starting from root • Example: /home/jsmith/mail • Relative Pathname • Path to a file or directory relative to the starting point • Example: ./mail
Accessing a UNIX system • Logging in identifies you to the system. • You must have a user account on the system to log in. • Systems Administrators are responsible for creating and maintaining user accounts.
Logging In • You will be presented with a prompt similar to the following: SunOS 5.7 Login: Password:
Logging In • Type your username (login ID) at the prompt and press Enter. • Then type your password at the prompt, and press Enter. • Note that your password will not appear as you type it for security reasons. • UNIX is CaSe-SeNsItIvE… however, most objects are lowercase for ease of typing. • If your login is successful, you will be greeted with a shell prompt ($).
UNIX network configuration files • /etc/hosts • Lists IP address and hostname of the system • Can include IPs and names of other systems • First is the loopback (localhost) address • Next is the real IP address of the system 127.0.0.1 localhost 192.168.5.6 cocoa 192.168.5.45 coffee
UNIX network configuration files • /etc/resolv.conf • Lists Domain Name Service (DNS) resolution information • First is the domain the system is in • Next are the nameservers it users domain psu.edu server 128.118.25.3 server 128.118.141.32
UNIX network configuration files • /etc/defaultrouter • Lists the default network gateway for the system 192.168.5.1 • /etc/netmasks • Lists the network and subnet mask 192.168.0.0 255.255.255.0
UNIX network information • ifconfig –a command • Shows information about the system’s Ethernet interface(s) lo0: flags=849<UP,LOOPBACK,RUNNING> mtu 8232 inet 127.0.0.1 netmask ff000000 hme0: flags=843<UP,BROADCAST,RUNNING> mtu 1500 inet 192.168.5.6 netmask ffffff00 broadcast 192.168.5.255
Working with Directories • Determine what directory you’re in: pwd (print working directory) Example: $ pwd /home/jsmith
Working with Directories • Change to another directory: cd Example: $ cd /home/jsmith/mail
Working with Directories • cd command with an absolute pathname $ cd /home/jdoe/mail • cd command with a relative pathname (if already in /home/jdoe) $ cd mail • Change to the parent directory $ cd ..
Displaying Files and Directories • List files and directories. $ ls dir1 file1.txt file2 pong • List all files and directories, including hidden files (files beginning with a ‘ . ‘ ) $ ls –a .kshrc dir1 file1.txt file2 pong
Displaying Files and Directories • Displaying file types. $ ls -F dir1/ file1.txt file2@ pong* • / indicates a directory. • * indicates an executable. • @ indicates a symbolic link to another file. • No symbol is a regular file, which could be plain or ASCII text.
Displaying Files and Directories • Displaying detailed information. $ ls -l drwx------ 2 jsmith users 512 Feb 28 19:28 dir1 -rw-rw-r-- 1 jsmith users 27 Feb 28 19:29 file1.txt lrwxrwxrwx 1 jsmith users 9 Feb 28 19:29 file2 -> file1.txt -rwx------ 1 jsmith users 23 Feb 28 19:29 pong
Displaying Files and Directories • File types and permissions • Number of hard links to other files • Owner • Group • Size of file in bytes • Last modification time • Filename