Introduction To Unix Operating System Main Components of A Computer
Introduction To Unix Operating System Main Components of A Computer
1.2 Hardware
The four main hardware components of a computer are the random access memory ',(+), the CP", the input-output 'I-.) de*ices, and the hard disk or other mass storage de*ice. 1.2.1 Random Access Memory ,(+ is the main computer memory which is often referred to as physical memory. Programs and data must e loaded into physical memory for the system to process them. The statement, /The system has 012 + ytes of memory,/ refers to the amount of ,(+ or physical memory currently installed. ( software program resides on the hard disk and, when acti*ated, an image or copy of that program is loaded into ,(+. In em edded systems hard disk is often a 3lash memory i.e. internal solid state non4 *olatile memory. Programs remain in ,(+ as long as needed. When the programs are no longer re5uired, they can e o*erwritten y copies of other programs. If the system is re ooted or e#periences a power loss, all data in physical memory is cleared. 1.2.2 Centra Processing Unit The CP" is the computer logic chip that e#ecutes instructions recei*ed from physical memory. These instructions are stored in a inary language. There can e se*eral CP"s in a computer and se*eral cores in a CP". In CP" there is usually also memory a*aila le and in small em edded systems it may e all the memory a*aila le 'like toys, dri*ers and adapters). 1.2.! Input"Output #e$ices The I-O component reads input from a de*ice, such as a key oard, into memory, and it writes output from memory to a de*ice, such as a terminal window.
6our input de*ices include the key oard and mouse. &isplay, printer and tape dri*e are e#amples of primary output de*ices. 1.2.% &ard #is' The hard disk is a magnetic storage de*ice in which files, directories, and applications are stored.
2. Unix history
2.1 UNIX
"ni# was originally de*eloped in 1=>= y a group of (T?T employees at Bell $a s 'including @en Thompson, and Brian @ernighan, &ennis ,itchie who is thought as founder of C4programming. +ain ad*antage in "ni# operating system was that it was programmed in higher language than assem ler making it much easier to port it to other processor systems. /The Open !roup, an industry standards consortium, owns the A"ni#B trademark. Only systems fully compliant with and certified according to the Single "7I8 Specification are 5ualified to use the trademarkC
others may e called /"ni# system4like/ or /"ni#4like/ 'though the Open !roup disappro*es of this term). Dowe*er, the term /"ni#/ is often used informally to denote any operating system that closely resem les the trademarked system./ ;1<
2.3 #assword
Password is needed also to gain access on a "ni# computer with a username. Password authoriIation is done efore log in is completed and session started. Password strength is a measure of the effecti*eness of a password in resisting guessing and rute4force attacks.
2.$ She!!
When you log in to the "ni# computer, shell will e started 'in " untu applications menu9 Terminal). The shell is a command line interprter which reads command and e#ecutes the relati*e program. The shell operates etween the kernel and user. There are many different shells 'sh, ash, csh, tcsh). Within a session you can start se*eral shells. The shell starts as other programs with its name e.g. ash. %#it from shell with command e#it.
2.%.2 C She
The C shell was de*eloped y Bill Moy at the "ni*ersity of California at Berkeley. It is ased on the C programming language and has a num er of features, such as command line history, aliasing, and No control. This shell has een fa*ored o*er the Bourne shell y ordinary system users. The default C shell prompt for a regular user account is the host name followed y a percent sign 'hostname:.).
2.% root directory In "ni# system files are arranged like an upside down tree, e*erything eginning from a directory called root denoted with character -. 6ou can list the resourses on systems root directory with command s ". (lways when gi*ing files as arguments to commands you can refer them with the a solute path, gi*ing the whole path to that file eginning with the root like s "users2"'"'irsirat. 2.& home directory When you start a session y login to a "ni# system your first working directory will e your home directory, named like your username. 6ou can get ack to your home directory at any time y issuing the command cd without any arguments. 6ou can refer to your own home directory also with the special character 3 'tilde). 6ou can refer to another users homedirectory in the same system y Pusername.
old settingsKcomment out the original lines with ARB. (lways insert a short comment descri ing what you ha*e done 'for your own enefitT). L. $inu# is inherently multi4user. 6our personal settings 'and all other personal files) are in your home directory which is -home-your user login name. +any settings are kept in files with names starting with a dot B.Bso as to keep them out of your way 'see point F a o*e). 6ou ha*e to login to do anything. H. System4wide settings are kept in the directory -etc. =. "nder $inu#, as in any multiuser operating system, directories and files ha*e an owner and a set of permissions. 6ou will typically e allowed to write only to your home directory which is -home-your user login name. $earn to use the file permissions else you will e constantly annoyed with $inu#. 1.. Command options are introduced y a dash, B4B, followed y a single letter 'or K when the option is more than one letter). Thus B4B is an e5ui*alent of &OSSs switch B-B. 3or e#ample, try rm 44help. 11. Type command ? 'the command name followed y an ?) to start a command in the ackground. This is usually the preferred way of starting a program from the 84window terminal./;F<
"
command
4option5s67
4argument 5s67
!.1.1 command
4 %#ecuta le 'specifies what the system is to do)
!.1.2 options
4 +odifies the command 'this specifies how the command is run). Options start with a 4 'dash) character. Options, which guide the functioning of a command, are usually single characters in front of which you ha*e the preceding minus sign. Options can e com ined
!.1.! Argument
4 ( file name, directory name, or te#t. The names of input files are gi*en last the command normally e#ecutes a default function, If the input files are not gi*en, the command normally e#ecutes a default function reading the input information from stdin 'terminal).The reading ends with control4&. The s5uare rackets are not written out. The s5uare rackets indicate that options and arguments, are not compulsory.
1#
>. ls pu 'ta pu licUhtml-) Command line completion 'also ta completion) is a common feature of command line interpreters, in which the program automatically fills in partially typed commands. L. ls 4l pu licUhtmlH. cal The cal command displays a calendar for the current month. =. cal 2 2..2 3e ruary 2..2 Su +o Tu We Th 3r Sa 1 2 F G 0 > L H = 1. 11 12 1F 1G 10 1> 1L 1H 1= 2. 21 22 2F 2G 20 2> 2L 2H 1.. uname 4rpns $inu# eduni#.metropolia.fi 2.>.1H41=G.11.G.el0 #H>U>G H. e#it
11
6ou can in*oke the man command with the 4k option for a keyword lookup to display a list of the commands that might e rele*ant. When you are not sure of the name for a command, you can use the 4k option with the man command to specify a keyword as a su Nect. J man 4k calendar
Action &isplays the ne#t screen of a man page Scrolls through a man page one line at a time +o*es ack one screen +o*es forward one screen Wuits the man command Searches forward for this pattern 3inds the ne#t occurrence of pattern Pro*ides a description of all scrolling capa ilities
!.2.! apropos
apropos topic !i*e me the list of the commands that ha*e something to do with my topic.
!.2.% +hatis
What is topic !i*e me a short list of commands matching my topic. whatis is similar to apropos 'see the command a o*e)K they oth use the same data ase. But whatis searches keywords, while apropos also searches the descriptions of the keywords.))
J uname
12
The who command displays a list of users currently logged in to the local system, with their login name, login terminal identifier 'TT6) Port, login date and time, and the elapsed time since their last acti*ity. When a user is logged in remotely, the remote system name displays for that user.
J dateCcalCpwd
13
To enter a se5uence of control characters, hold down the Control key and press the appropriate character on the key oard for the desired action. Ta le lists the control characters you can use.
Contro Characters
Purpose
Terminates the command currently ,unning ' intr) %rases all characters on the current command line 'kill) Stops output to the screen ,estarts output to the screen after Control4S has een pressed Indicates end4of4file or e#it %rases the last word on the command line Suspends a process. 6ou can return to the suspended process y entering the command fg 'foreground).
$. - pea) ahead
xamp!e $.1 .i!es and directories
1. Start Putty and login 2. cd pu licUhtml Change directory to pu licUhtml. F. nano inde#.html Start the te#teditor named nano to edit file named inde#.html. G. XDT+$YXTIT$%Y+y home pageX-TIT$%YXBO&6Y(*aila le soon...X-BO&6YX-DT+$Y Content of the file. 0. control48 %#it nano. >. 6
14
%. 2eferences
;1< http9--en.wikipedia.org-wiki-"ni# '10.=.2.1.) ;2< http9--www.linu#.org-lessons- eginner-l1-lesson1 .html '2L.=.2.1.) ;F< http9--lnag.sourceforge.net-downloads-$inu#7ew ie(dministrator!uide.pdf '21.=.2.1.) ;G< http9--en.wikipedia.org-wiki-PasswordUstrength 'F.1..2.1.) ;0< http9--www.ee.surrey.ac.uk-Teaching-"ni#-uni#intro.html '1.11.2.11)