Escolar Documentos
Profissional Documentos
Cultura Documentos
Sun Microsystems
Vikash Sharma
An Operating system (OS) is a collection of files and directories that interacts between the hardware and the software of the system An OS is a software which is initially loaded into a systems harddisk by a boot program to manage all the other programs in a computer All major computer platforms (Hardware and Software) require an OS
Examples of OS
LINUX WINDOWS
XP,2000
HP
UX
IBM
AIX - OS
SOLARIS
MAC
It was developed originally at AT&T Bell Laboratories in 1969 by Ken Thompson and Dennis Ritchie Modifications were made to the original source code at the University of California at Berkeley which resulted in the Berkeley Software Distribution (BSD) UNIX. One of the important modifications in the UNIX OS made by the programmers at Berkeley was the addition of networking software which enabled the OS to function in a Local Area Network (LAN)
The PDP-7
In a few years individual companies came out with their own form of the originally created BSD Unix by adding more tools and making modifications in the source code. In 1988 some OS were folded together to make the System V release 4(SVR4) UNIX. The SVR4 became the basis for many OS like Solaris,Hp UX,Linux,Ibm AIX.
UNIX OS Solaris
Kernel is the core of the Unix OS The kernel interacts between the software and the hardware in a system. It manages all the physical resources in the computer including File Systems, Device Management, Process Management, Memory management...etc.. The kernel (Static core of an OS) is made up of two modules Genunix and Unix Shell is the primary command interpreter It accepts the commands that the user enters, it then interprets these commands and passes it to the kernel. The kernel then executes the commands in regards to what the user has requested.
Types of Kernels
Monolithic Kernel
MicroKernel
In a Monolithic Kernel all OS services run along with the Kernel residing in the same area. Monolithic kernels are dependent upon the system components (Such as hardware and software components)
Microkernel are micro hardware components that interacts with the software of the OS to perform services Memory Management, Multitaskingetc
Types of Shells
Bourne Shell
C Shell (csh) Has added feature (CMD line history, Job controletc..) Korn Shell (ksh) Is a combination of the Bourne Shell and has C Shell like enhancements with more added features (Command Line Editing) Bash Shell (bash) (Bourne Again Shell) Is a combination of the Korn Shell and C Shell
Z Shell (zsh) It resembles the Korn Shell but with many other added enhancements TC Shell (tcsh) It resembles the C Shell but with many other added enhancements
DIRECTORY HIERARCHY
It makes up the File System which is a organized group of directories and files that help in running applications. It is also a method for storing files and organizing computer files. It uses a data storage device such as a hard disk or a CD ROM.
Solaris
The Solaris 10 OS is a virtual memory operating system. (It enables execution of programs as if more memory is available than the physical RAM) It consists of SunOS 5.x, Open Network Computing (ONC+) Software
Unix system commands instructs the system to perform specific functions A Command Syntax consists of a Command name, Options and Arguments Commands in Unix are case sensitive The behavior of command functions can be altered by using Options and Arguments The preferred mode of login in an Unix environment is the Command Line login
uname n Provides the host name of the system uname a Shows the information currently available on
the system
showrev This command display the systems information with the Host ID
Enables the user to define exactly what he/she wants to do with the command
Example of a Command with an Argument cal 12 2004 1st argument specifies the month and 2nd argument specifies the year that needs to be viewed
File Types
NAME Regular Files Directories Symbolic Links Block special device files Character special device files
SYMBOL d l b c
Using ls Command
A single period ( . ) represents the current working directory and the double period( ..) represents the parent directory which contains the working directory
Using cd Command
When logged into the system by default the current working directory is the users home directory. The cd command is used to navigate between directories in the directory hierarchy
mkdir p newdir /empty The p option checks for directory (If directory does not exist, a directory is created - newdir) and then creates the directory - empty
Using cp Command
This command copies directories and files from one location to another location To copy a file To copy a dir
Using mv Command
-- Moves a directory into the destination
directory
When the destination directory exists, the mv command moves the directory into the destination directory
This command moves or renames a directory -- Renames a directory when a destination directory does not exist
The touch command is used to create a zero byte file and it puts a time stamp on an existing file
To run certain programs a required set of zero bytes files are required
cat Command is used to create, read, and append a file Creating and Reading a file
It is an interactive editor that can be used to create and modify text files It is the only text editor that can be used to edit certain system files without changing the permission of the files All changes in the vi editor takes place in the buffer, and changes can be written to the disk or can be discarded
The more command displays the content of a file in a page wise display
The tail command displays the contents of a file with ( - ) and ( + ) options
The wc (Word Count) command displays numbers of lines, words, characters, memory size
The which command shows the location of the commands From where the command is executed
The echo command shows the value of the given variable or shows the variables environmental path
The grep command identifies the line with the matching pattern and displays it. Multiple options can be used along with grep Examples of options along with grep command ( -n ) Displays the line number along with the contents of the line ( -v ) Displays lines that do not match with the given pattern
The egrep command searches the contents of one or more files with the matching pattern It uses extended regular expression metacharacters (Metacharacters of the grep command plus some additional metacharacters) + Matches one or more metacharacters x|y Matches either x or y
The pgrep (Process grep) command displays the Process ID along with the Parent Process ID
The find command is used to find a directory or file in the system ( find /(dir name) option (dir/file name )
Using su Command
This command is used to switch over from one user (ex: root) to another user (ex: user1)
The who command shows the users information Options in the who Command
who who
am i whoami
The finger command displays the information of a user along with the user status
Using ln Command
The ln command is used to create a Symbolic link and Hard link Symbolic Link It is a link between a source file and a destination file. If the source is deleted the destination file does not exist.
Hard Link This is also a link between a source file and a destination file. If the source is deleted the destination file still exists
File Permissions
r Readable/ w Writable/ x Executable/ ( - ) - Denied
Owner Permissions of the owner of the file or directory Group Permissions for all the members of the group to who the file or directory belongs to Others Permissions for all other users except the owner and the group to who the file or directory belongs to
Examples of Permissions
- This file has Read, Write and Executable permissions set for the Owner of the file only - This directory has Read and Execute permissions set for the Owner and Group of the directory - This file has Read, Write and Execute permissions for the Owner. It also has Read and Execute permissions for the Group and Others
Default UMASK Value is 022. To view the umask value the command is (# umask )
To view the path where the umask value is set more /etc/default/login
OCTAL VALUE UMASK VALUE
OWNER 7 (-) 0
GROUP 7 (-) 2
OTHERS 7 (-) 2
The vi editor is a command line editor that has three different modes ( Case Sensitive Editor) Command Mode Edit Mode Last Line Mode
Command Line Mode: It is the default mode for the vi editor. Commands can be entered to delete, change, copy and move text in a file and also used to position the cursor ( vi filename )
Edit Mode: This mode is used to enter text in a file ( i, o, a, etc..) Last Line Mode: This mode enables the user to edit advanced commands such as to save a file ( : ) Cursor moves to the last line of the screen ex: ( q!) Exits the vi editor without saving a file ( :wq! ) Saves a file and exits the vi editor
w ----- Moves one word forward b ----- Moves one word back e ----- Moves to the end of the current word
$ ----- Moves to the end of the line 0 (Zero) ----- Moves to the beginning of the line Return key ----- Moves to the beginning of the next line G ----- Moves to the last line of the file 1G ----- Moves to the first line of the file :n ( ex - :5 ) ----- Moves to the specified line (Line 5) Ctrl F ----- Moves one page forward Ctrl B ----- Moves one page back R ----- Overwrites and replaces characters at cursor
position and to the right of the cursor C ----- Overwrites and replaces character from cursor to the end of the line
x ----- Deletes a character at the cursor dd ----- Deletes the line containing the cursor D ----- Deletes the line from the cursor to the right end of
the line u ----- Undoes previous command U ----- Undoes all changes to the current line r ----- Replaces the character at the cursor with another character
. ----- Repeats the previous command yy ----- Copies the line P ----- Places the copied line below the cursor p ----- Places the copied line above the cursor
:wq! ----- Saves the file with changes and quits the editor :q! ----- Quits without saving the file