forked from henrythemes/jekyll-bootstrap-theme
-
Notifications
You must be signed in to change notification settings - Fork 33
/
unixintro.html
111 lines (107 loc) · 7.7 KB
/
unixintro.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> UNIX Tutorial - Introduction</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="Copyright" content="Michael Stonebank, 1995-2003" />
<link href="unixtut2.css" rel="stylesheet" type="text/css" />
<link href="unixtut2-print.css" rel="stylesheet" type="text/css" media="print" />
</head>
<body>
<div id="container">
<h2>A copy from <a href="http://www.ee.surrey.ac.uk/Teaching/Unix/"><font color="lightgrey">UNIX Tutorial for Beginners</font></a> with modified paths<br>Please use <a href="https://scilifelab.github.io/courses/ngsintro/common/emu/"><font color="lightgrey">this terminal emulator</font></a> when doing the exercises!</h2>
<h1>UNIX Introduction </h1>
<h2>What is UNIX? </h2>
<p><img src="media/unix-plate2.jpg" alt="UNIX® License Plate" width="189" height="114" border="0" align="right" />UNIX is an operating system which was first developed in the 1960s, and has been under constant development ever since. By operating
system, we mean the suite of programs which make the computer work. It is a stable, multi-user, multi-tasking system for servers, desktops and laptops. </p>
<p> UNIX systems also have a graphical user interface (GUI) similar to Microsoft Windows which provides an easy to use environment. However, knowledge of UNIX is required for operations
which aren't covered by a graphical program, or for when there is no windows
interface available, for example, in a telnet session.</p>
<h2>Types of UNIX</h2>
<p><img src="media/linux-penguin-small.png" alt="The Linux Penguin" width="80" height="96" hspace="8" align="right" />There are many different versions of UNIX, although they share common similarities. The most popular varieties of UNIX are Sun Solaris, GNU/Linux, and MacOS X. </p>
<p>Here in the School, we use Solaris on our servers and workstations, and Fedora Linux on the servers and desktop PCs.</p>
<h2>The UNIX operating system </h2>
<p>The UNIX operating system is made up of three parts; the kernel, the shell
and the programs. </p>
<h3>The kernel </h3>
<p>The kernel of UNIX is the hub of the operating system: it allocates time and
memory to programs and handles the filestore and communications in response
to system calls. </p>
<p> As an illustration of the way that the shell and the kernel work together,
suppose a user types <span class="command">rm myfile</span> (which has the effect of removing
the file <strong>myfile</strong>). The shell searches the filestore for the
file containing the program <span class="command">rm</span>, and then requests the kernel, through
system calls, to execute the program <span class="command">rm</span> on <b>myfile</b>. When the process
<span class="command">rm myfile</span> has finished running, the shell then returns the UNIX
prompt % to the user, indicating that it is waiting for further commands. </p>
<h3>The shell</h3>
<p>The shell acts as an interface between the user and the kernel. When a user
logs in, the login program checks the username and password, and then starts
another program called the shell. The shell is a command line interpreter (CLI).
It interprets the commands the user types in and arranges for them to be carried
out. The commands are themselves programs: when they terminate, the shell gives
the user another prompt (% on our systems). </p>
<p> The adept user can customise his/her own shell, and users can use different
shells on the same machine. Staff and students in the school have the <b>tcsh shell</b> by default. </p>
<p> The tcsh shell has certain features to help the user inputting commands.</p>
<p> Filename Completion - By typing part of the name of a command, filename or
directory and pressing the [<b>Tab</b>] key, the tcsh shell will complete the rest
of the name automatically. If the shell finds more than one name beginning with
those letters you have typed, it will beep, prompting you to type a few more
letters before pressing the tab key again. </p>
<p> History - The shell keeps a list of the commands you have typed in. If you
need to repeat a command, use the cursor keys to scroll up and down the list
or type history for a list of previous commands. </p>
<p> </p>
<h2>Files and processes </h2>
<p>Everything in UNIX is either a file or a process. </p>
<p> A process is an executing program identified by a unique PID (process identifier).
</p>
<p> A file is a collection of data. They are created by users using text editors,
running compilers etc. </p>
<p> Examples of files: </p>
<ul>
<li> a document (report, essay etc.) </li>
<li> the text of a program written in some high-level programming language </li>
<li> instructions comprehensible directly to the machine and incomprehensible
to a casual user, for example, a collection of binary digits (an executable
or binary file); </li>
<li> a directory, containing information about its contents, which may be a
mixture of other directories (subdirectories) and ordinary files. </li>
</ul>
<p> </p>
<h2>The Directory Structure </h2>
<p>All the files are grouped together in the directory structure. The file-system
is arranged in a hierarchical structure, like an inverted tree. The top of the
hierarchy is traditionally called <strong>root</strong> (written as a slash / ) </p>
<p align="center"><img src="media/unix-tree.png" alt="Unix File Structure" width="560" height="316" /></p>
<p> In the diagram above, we see that the home directory of the undergraduate student <b>"ee51vn"</b> contains two sub-directories (<b>docs</b> and <b>pics</b>) and a file called <b>report.doc</b>. </p>
<p>The full path to the file <b>report.doc</b> is <b>"/home/its/ug1/ee51vn/report.doc" </b></p>
<h2>Starting an UNIX terminal </h2>
<p>To open an UNIX terminal window, click on the "Terminal" icon from Applications/Accessories menus.</p>
<p align="center"><img src="media/gnome-window.gif" alt="Gnome Menus" width="518" height="396" /></p>
<p> </p>
<p> An UNIX Terminal window will then appear with a % prompt, waiting for
you to start entering commands.</p>
<p>
<span style="color:red">
<b>NOTE:</b>
Terminals can have many different appearances, which can be confusing in the beginning.
The thing all the appearances have in common is that they have 'strange character' as indicator of the line where you type stuff.
In this exercises they use the percent character, %, and in the terminal emulator they have chosen the brackets character, # .
Most commonly used is the dollar character, $ .
</span>
</p>
<p align="center"><img src="media/unix-xterm0.gif" alt="Unix Terminal window" width="491" height="269" /></p>
<p> </p>
<p align="center" class="navbar"><a href="unix0.html"><img src="media/left.gif" alt="Previous" width="37" height="39" border="0" /></a>
<a href="index.html"><img src="media/home.gif" alt="Home" width="81" height="39" border="0" /></a><a href="unix1.html"><img src="media/right.gif" alt="Next" width="37" height="39" border="0" /></a></p>
<p align="center"><script type="text/javascript"><!--
amazon_ad_tag = "unixtutorialf-20"; amazon_ad_width = "728"; amazon_ad_height = "90"; amazon_ad_logo = "hide"; amazon_ad_link_target = "new"; amazon_ad_price = "retail"; amazon_color_border = "E9ECF5"; amazon_color_link = "0000FF"; amazon_color_logo = "093697"; amazon_ad_categories = "abcdefg";//--></script>
<script type="text/javascript" src="http://www.assoc-amazon.com/s/ads.js"></script></p>
<p class="date">[email protected], © 9th October 2000
</p>
</div>
</body>
</html>