-
Notifications
You must be signed in to change notification settings - Fork 0
/
linuxTutorial.html
157 lines (152 loc) · 4.62 KB
/
linuxTutorial.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
<link rel="stylesheet" href="css/style.css" type="text/css" media="all" />
<link rel="stylesheet" href="jqconsole/css/ansi.css" type="text/css" media="all" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="jqconsole/lib/jqconsole.js"></script>
<script src="lib/instructions.js"></script>
<script src="lib/filesystem.js"></script>
<script src="lib/commands.js"></script>
<script src="lib/tutorial1.js"></script>
<script src="lib/tutorial2.js"></script>
<script src="lib/tutorial3.js"></script>
<script src="lib/linuxTutorial.js"></script>
<style>
html, body {
background-color: #333;
color: white;
font-family: monospace;
margin: 0;
padding: 0;
}
/* The console container element */
#console {
height: 400px;
width: 500px;
position:relative;
background-color: black;
border: 2px solid #CCC;
margin: 0 auto;
margin-top: 50px;
}
/* The inner console element. */
.jqconsole {
padding: 10px;
padding-bottom: 10px;
}
/* The cursor. */
.jqconsole-cursor {
background-color: #999;
}
/* The cursor color when the console looses focus. */
.jqconsole-blurred .jqconsole-cursor {
background-color: #666;
}
/* The current prompt text color */
.jqconsole-prompt {
color: #0d0;
}
/* The command history */
.jqconsole-old-prompt {
color: #0b0;
font-weight: normal;
}
/* The text color when in input mode. */
.jqconsole-input {
color: #ff0;
}
/* Previously entered input. */
.jqconsole-old-input {
color: #bb0;
font-weight: normal;
}
.brace {
color: #00FFFF;
}
.paran {
color: #FF00FF;
}
.bracket {
color: #FFFF00;
}
.jqconsole-composition {
background-color: red;
}
/* The text color of the output. */
.jqconsole-output {
color: white;
}
</style>
<script>
$(function() {
// Creating the console.
var header = "";
window.jqconsole = $('#console').jqconsole(header, 'pi@Kano:/$ ');
// Abort prompt on Ctrl+Z.
jqconsole.RegisterShortcut('Z', function() {
jqconsole.AbortPrompt();
handler();
});
// Move to line start Ctrl+A.
jqconsole.RegisterShortcut('A', function() {
jqconsole.MoveToStart();
handler();
});
// Move to line end Ctrl+E.
jqconsole.RegisterShortcut('E', function() {
jqconsole.MoveToEnd();
handler();
});
// Ctrl+R: resets the console.
jqconsole.RegisterShortcut('R', function() {
jqconsole.Reset();
handler();
});
// Handle a command
var handler = function(command) {
// Process the command
if (command) {
runLesson(command);
handler(); // Needed for clear()
}
jqconsole.Prompt(true, handler, function(command) {
// Continue line if can't compile the command.
try {
//Function(command);
} catch (e) {
if (/[\[\{\(]$/.test(command)) {
return 1;
} else {
return 0;
}
}
return false;
});
};
// Redirect focus to the console whenever the user clicks anywhere.
$(window).click(function() {
jqconsole.Focus();
})
// Initiate the first prompt.
handler();
});
</script>
</head>
<div id="title">
Lesson 1.1: Welcome
</div>
<div id="instructions">
<i>Linux</i> is an open source operating system. There are two posible ways of using it: through the graphical interface (boring...) or through a command-line interface, called the <i>shell</i>.<br><br>
You will learn how to use the shell (the black window) with this tutorial. The $ sign is called a <i>terminal prompt</i>.<br><br>
Just to warm up type <b>Echo</b> and press enter.
</div>
<div id="image">
<img id='systemImg' src="images/filesystem1.png" alt="file system" style="visibility:hidden">
</div>
<body>
<div id="console"></div>
</body>
</html>