Sie sind auf Seite 1von 10

Lecture1 Operating systems:

UNIX
Solaris HP-UX AIX MAC SUN s UNIX operating system [Express: Solaris 11] HP's UNIX operating system [HP-UX 11.3] IBM s UNIX operating system [AIX 6.1] Apple operating system [MAC 10.6]

Ass: Check for latest version

LINUX
Fedora Redhat Ubuntu Debian SUSE 12 6.1 ubuntu 9 boot in 25 second while ubuntu 10 boot in 10 sec presto need no time boot in 13 sec 9.10

10 latest version

Windows
Windows 3.1 and NT Windows 95 Windows NT 4.0 Windows 98 Windows 2000 Windows Millennium Edition (Me) Windows XP Windows Server 2003 Windows Vista Windows 7 All of the previous competitors wanna the operating system to be: User friendly Multi-users Network for data sharing

History of UNIX
Points: - General electric / MIT / bell labs all participate in MULTICS OS project from 1964 till 1969 (SLOW) - Then Bell Labs which is now research and development organization of Alcatel-Lucent and previously of the American Telephone & Telegraph Company AT&T [largest provider of local, long distance telephone services in the United States, and also Internet access and digital television and second largest provider of wireless service in the United States separated from the MULTICS project and begin its own project

UNIX

- Ken Thompson: Begin to rewrite the MULTICS and rename it with UNIX using assembler (1971) - Dennis Ritchie and Ken Thompson rewrite the source code using c language (1974) then publishing the source code among the universities and a lot of developers begin to fix some bugs and develop in the code - (1989) AT&T and Sun micro system make SVR4 [BSD(which is made by Berkeley university ) + xenix + SUN OS) - Then other UNIX system begins to be used: BSD (Berkeley University) HP-UX (hp) Solaris (Sun Microsystems) AIX (IBM) POSIX(IEEE) Standard for UNIX after there were two standards for UNIX [BSD SVR] which were totally different so this standard for all UNIX operating system

History of LINUX Andrew S. Tanenbaum : begin to write source code for operating system called MINIX Which is similar to UNIX without using the source code of the UNIX Richard Stallman (1983) begin GNU project to make OS similar to UNIX but for free so the LINUX is UNIX like but for free Linus Torvalds (1991) begin Linux which depends on MINIX and POSIX standard

UNIX features

SECURE and Virus rare

UNIX (and even Linux) is NOT virus free. Although rare, there are viruses for such systems. One of the primary reasons that Unix / Linux do not get as many viruses is that the ability of different users is limited. Non-technical users will be restricted in their ability to install, run, or modify software. More experienced users will usually be given more privileges. Without inexperienced users installing software at a whim, over 90 % of the threat of viruses and malware is removed Reliable

Any single failure can be detected without interrupting the system Multi-User

More than one user can use the machine at a time supported via terminals (serial or network connection) authentication & authorization one of UNIX main issue in UNIX multi-user is only available for windows server

Performance

TREE
Similar to windows partitions C: D: E:

etc

bin

usr

cdrom

opt

var
/var/adm/message

export
home

passwd

shadow

SAM file in group windows

bin

man

sbin

dt

etc: Directory reside in it the configuration files of the system shadow-passwd-system bin: Shortcut for /usr/bin opt: Default directory or mount point for add-on application packages and patches(optional software) as the program files in windows for third party application

var: The directory for varying files, which usually includes temporary, logging, or status files It is important that the /var directory has sufficient disk space available to store software package information, log files, spool files, mails and so on Ex:spoolingprinter + loggingsystem /var/adm/message Usr: similar to windows dir in windows

At login: Take care of the login name to root and no restriction for password but if you are normal user there is restrictions At login look at /etc/passwd then /etc/shadow /etc/passwd??? username : x : user id : primary group id : comment : home directory : shell of user Any user can be in many groups [1 primary group and the rest secondary groups which can be known from /etc/group] The first measure is to authenticate a user s login by verifying that the user name and password exist in the /etc/passwd and /etc/shadow files. - 0-99 Reserved for system users - 100 60000 It can be more than that but it s for compatibility with older versions Open it gui and check it root id should be zeroooooo :D /etc/shadow??? Login name: encrypted password: last change : min : max : warn : inactive : expire : flag

- You should refrain from editing it directly - Only the root user can read the /etc/shadow file

What is shell???

Shell: Interface between the user and the kernel Accepts the commands that a user enters, interprets these commands, and passes them to the kernel open terminal right click terminal

Commands:

case/syntax/spelling/space

Some commands for illustration:

Clear : To clear the terminal cal : To display the calendar of current year cal year : To display calendar of this year cal month : To display calendar of this month date : To set the time(root) display(user) pwd : Print working directory cd directory : Change to this directory cd . : Still in the current directory cd .. : Go to the parent of directory cd - : Go to the previous directory you were stood on cd [Without dir name] : Go to the home directory cd ~ : Go to home directory ls as dir in windows ls directory : list the contents of this directory ls -l file : List information about this file ls -ld directory : List the information about this directory PS1= $PWD> To change the prompt to be as the current working directory eject cdrom : The only way to eject the cdrom

Relative and Absolute path:


Absolute:
Once the path is started from the

so this is absolute path of the file or directory

You will start to find file/dir starting from the / no matter where you are u standing on

# cd /usr/bin # ls l /etc/passwd

Relative:
# cd / The path never started from the / Once the path without / at the beginning so this path will be concatenated with current path Absolute Relative

# ls etc/passwd

cat & more:


cat: cat filename

- To display the short text file

- Display all the file at once - With option n it will display file numbered more: more filename

- To display long text file - Displays the contents of a text file one screen at a time - After opening file by more

touch & rm:


touch: touch filename

- To create an empty file - If you touch a file already exists so you are changing its modification time rm: - To remove file rm filename

mkdir & rmdir & rm r :


mkdir: mkdir directory

- To create a directory
-

mkdir p : to make dir inside dir in one step mkdir p dir1/dir11 dir1/dir12
So in previous example dir1 is created and then dir11 is created inside dir1 then dir12 will be created in dir1

rmdir:

rmdir directory

- Remove empty directories


-

rmdir p : to remove all the directories in the given path if and only if these
directories are empty

rmdir -p dir1/dir12
This command removes first the dir12 directory and then the dir1 but if a directory is not empty or does not have write permission when it is to be removed, the command terminates.

rm -r:

rm -r directory

- With the -r option to remove directories that contain files and subdirectories. Hint :To remove a directory in which you are currently working, you must change to its parent directory.

head & tail:


head:
-

head filename head -n filename

Displays the first 10 lines of a file without option

tail:
-

Display first n lines from the file

ex: head -4 /etc/passwd

tail filename
Displays the last 10 lines of a file without option

tail -n filename

wc:

Display last n lines from the file

ex: tail -4 /etc/passwd

tail +n filename
Display from line n to the end of the file ex: tail +4 /etc/passwd

wc filename

Displays number of lines words characters in this file If we add an option to the wc so you need specific result If you don t give wc a file name it will act differently lets see

wc

then press enter

information technology

then press ctl+d

In this case it will count the number of lines/words/characters of what you have written

who & finger & id:


who / finger:
Displays a list of users currently logged in to the local system locally or remotely. While finger display more information To know effective user The user who are typing now on the terminal

id:
-

man:
Manual pages for help

Searching Man Pages by Section


You can search within a specific section of the man pages by using the man command with the -s option. For example

Section 1 contains user commands Section 4 contains information about various file formats. man -s number command

or
man -s number filename You can use the man command with the -l option to list the man pages that relate to the same command or file name. $ man -l passwd

passwd (1) -M /usr/man passwd (4) -M /usr/man

section 1 section 4

Searching Man Pages by Keyword


When you are not sure of the name of a command, you can search for man page entries that are related by using the man command with the -k option and a keyword. The man command output provides a list of commands and descriptions that contain the keyword You can use this option unless you run the following command once on the system as a root this command will take some time catman $ man -k calendar
... (output truncated) cal cal (1) - display a calendar calendar calendar (1) - reminder service difftime difftime (3c) - computes the difference between two calendar times mktime mktime (3c) - converts a tm structure to a calendar time

Display all the manual pages for certain give


$ man a passwd Will display all the passwd pages in the manual sequentially

Das könnte Ihnen auch gefallen