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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
|
.. Objectives
.. ----------
.. At the end of this tutorial, you will be able to:
.. 1. Know what is linux and it's need.
.. 2. Understand the need for linux in today's world.
.. 3. Move around in directories and files.
.. 4. Use basic commands of Linux.
.. Prerequisites
.. -------------
.. 1. None
Script
------
.. L1
{{{ Show the first slide containing title, name of the production
team along with the logo of MHRD }}}
.. R1
Hello friends and Welcome to the tutorial on
'Getting started with Linux'.
.. L2
{{{ Show the slide, Objectives }}}
.. R2
At the end of this tutorial, you will be able to,
1. Know what is linux.
#. Understand the need for linux in today's world.
#. Move around in directories and files.
#. Use basic commands of Linux.
.. L3
{{{ Switch to slide, what is linux OS }}}
.. R3
Linux (sometimes called GNU/Linux) is a Free and Open Source Operating
System that is inspired by Unix and runs on a variety of hardware
platforms.
Linux is a modular operating system, with it's basic design based on the
principles established in Unix.
.. L4
{{{ Switch to slide, Why Linux? }}}
.. R4
GNU/Linux can be downloaded in its entirety from the Internet completely
for free with no registration fees, no costs per user, free updates, and
freely available source code.
The security model used in Linux is based on the UNIX idea of security,
which is known to be robust and of proven quality.
Linux is used a lot for scientific computing. Why? Beause,
we can share our operating system and the libraries that we are using
with our co-workers, without any headaches of licensing.
There are a host of tools and libraries, that are useful in day-to-day
scientific computing work.GNU/Linux distributions are very stable and
known for their up-time.
.. L5
{{{ Switch to slide, Logging in }}}
.. R5
Let's begin with logging into our system. The GNU/Linux OS supports
multiple users and each user logs in with his/her user-name and password.
You can log-in once you provide your authentication details.
It is a popular misconception that GNU/Linux doesn't have a GUI (Graphical
user interface). It does have a fully functional GUI, but for the purpose
of this course we shall start with using the CLI (Command line interface).
.. R6
Once your system has booted up, hit ``Ctrl + Alt + F1`` to switch to the
command line interface.
.. L6
{{{ Hit ``Ctrl + Alt + F1'' and login as ``fossee'' with it's password }}}
.. R7
To logout from the CLI, you can use the ``logout`` command.
.. L7
::
logout
.. R8
Now hit ``Ctrl + Alt + F7`` and come back to the GUI.
.. L8
{{{ Hit ``Ctrl + Alt + F7`` }}}
.. R9
For the purpose of spoken tutorials, we shall use the terminal on the GUI.
.. L9
{{{ Open the terminal }}}
.. R10
Now that we have logged in, where are we?
To find out the present working directory, we use the ``pwd`` command.
.. L10
::
pwd
.. R11
Now, to see what is in the current directory, we use the ``ls`` command.
.. L11
::
ls
.. R12
It gives us a list of all the files in our present working directory.
``ls`` command takes the directory, in which we want to see the list of
files present, as an argument. To see all the files present in the
``Music`` directory, we say
.. L12
::
ls Music
.. R13
Note that everything in GNU/Linux and the Unix world is case sensitive.
As you can see, our home folder has many files.
What if we wanted the files to be more organized? Say,
we would like to put all our work during this course in a separate
directory. Let us now create a directory ``sdes`` by saying
.. L13
::
mkdir sees
.. R14
Type ``ls`` to see that a new directory has been
created.
.. L14
::
ls
.. L15
{{{ Switch to slide, New folders }}}
.. R15
Also, note that special characters need to be escaped. For example if we
wanted to create a directory with the name ``software engineering``, we do
it either as
mkdir software \\ engineering
or as
mkdir "software engg"
But it is generally a practice to use hyphens or underscores instead of
spaces in filenames and directory names.
Also in modern GNU/Linux filesystems all characters except the forward
slash are allowed.
.. R16
Now that we have seen how to create a new empty directory and navigate into
it, let us create a new blank file. We use the ``touch`` command for this.
.. L16
{{{ Switch to the terminal }}}
::
pwd
cd sees
touch first
.. R17
This creates a file named first in our present working directory. Use the
``ls`` command to see that the file has been created.
.. L17
::
ls
.. R18
To get a quick description of the command, we could use the ``whatis``
command. It gives a short one-line description of the command that is
passed as an argument to it. For example,
.. L18
::
whatis touch
.. R19
To get a more detailed description of the command,
we use the ``man`` command.
.. L19
::
man touch
.. R20
This page gives a detailed description of the command. We can see that the
``touch`` command has a whole host of options that can be passed to it.
Every command in Linux has such a list of options that can be passed to the
command to do specific tasks. Hit the ``q`` key to quit the ``man`` page.
.. L20
::
q
.. R21
To see the manual on man itself do,
.. L21
::
man man
.. L22
{{{ Switch to slide, Using additional options }}}
.. R22
As you may have observed, often the ``man`` page is a bit too much for
quickly cross checking what option to use for a specific task. For this
kind of quick look-up, most of the commands come with a -h or --help
option. This gives a brief description of the options available for that
command.
Pause the video here, try out the following exercise and resume the video.
.. L23
{{{ Show slide with exercise 1 }}}
.. R23
Which option should be used with ``ls`` command to list all the directories,
sub-directories and files contained in it?
Hint: Use ``man`` or ``--help``
.. R24
Switch to terminal for solution.
.. L24
{{{continue from paused state}}}
{{{ Switch to the terminal }}}
::
ls -R
.. R25
This lists out all the files in the sub-tree of the current directory,
recursively.
.. L25
.. R26
When you wish to create a new directory deep inside a directory structure,
using a ``-p`` option with the ``mkdir`` command would be useful. For
example,if we wish to create a folder ``scripts`` inside the directory
``linux-tools`` inside the directory ``sees``, we could simply say,
.. L26
::
pwd
mkdir -p sees/linux-tools/scripts
.. R27
Let's now say, we wish to remove a directory or a file. How do we find out
what command to use? We use the ``apropos`` command to search for commands
based on their descriptions. To search for the command to remove a
file/directory say,
.. L27
::
apropos remove
.. R28
This gives us a whole list of commands that have the word ``remove``, in
their description. Looking through the list tells us that ``rm`` or
``rmdir`` is the command to use.
.. L28
.. L29
{{{ Show summary slide }}}
.. R29
This brings us to the end of the tutorial.In this tutorial, we have learnt to,
1. Understand the basic structure of linux and it's need.
#. Use ``pwd'' command, to check the current working directory.
#. List a directory's contents by using the command ``ls''.
.. L30
{{{ Show the Summary... slide }}}
.. R30
#. Use commands like ``mkdir`` and ``rmdir`` to make and remove directories
respectively.
#. Use commands such as ``man`` and ``whatis`` to get a description of
what a particular command does.
#. Search the manual page names and descriptions, using the ``apropos'' command
.. L31
{{{ Show self assessment questions slide }}}
.. R31
Here are some self assessment questions for you to solve
1. What is the default directory after logging into the terminal?
2. How to view file attributes with ls command?
.. L32
{{{ Solution of self assessment questions on slide }}}
.. R32
And the answers,
1. It logins to user's home(/home/user)
2. In order to view the attributes of a file, we use the -l option with
the ls command.
::
ls -l <filename>
.. L33
{{{ Show the SDES & FOSSEE slide }}}
.. R33
Software Development techniques for Engineers and Scientists - SDES, is an
initiative by FOSSEE. For more information, please visit the given link.
Free and Open-source Software for Science and Engineering Education - FOSSEE, is
based at IIT Bombay which is funded by MHRD as part of National Mission on
Education through ICT.
.. L34
{{{ Show the ``About the Spoken Tutorial Project'' slide }}}
.. R34
Watch the video available at the following link. It summarises the Spoken
Tutorial project.If you do not have good bandwidth, you can download and
watch it.
.. L35
{{{ Show the `` Spoken Tutorial Workshops'' slide }}}
.. R35
The Spoken Tutorial Project Team conducts workshops using spoken tutorials,
gives certificates to those who pass an online test.
For more details, contact contact@spoken-tutorial.org
.. L36
{{{ Show the ``Acknowledgements'' slide }}}
.. R36
Spoken Tutorial Project is a part of the "Talk to a Teacher" project.
It is supported by the National Mission on Education through ICT, MHRD,
Government of India. More information on this mission is available at the
given link.
.. L37
{{{ Show the Thankyou slide }}}
.. R37
Hope you have enjoyed this tutorial and found it useful.
Thank you!
|