Linux/C2/Basic-Commands/English-timed
From Script | Spoken-Tutorial
Revision as of 17:08, 8 March 2015 by Sandhya.np14 (Talk | contribs)
Time | Narration |
00:00 | Dear friends, welcome to a spoken tutorial on the Linux Operating System. |
00:05 | In this tutorial, we will study some basic commands. |
00:10 | I am using Ubuntu 10.04. |
00:12 | We assume that you know how to get started with the Linux operating system. |
00:17 | If you are interested, it is available through another spoken tutorial, on the website http://spoken-tutorial.org. |
00:26 | In this tutorial, we will see what are commands and what is a command interpreter. |
00:33 | Then we will learn about how to find help in Linux using the man command. |
00:39 | Now the first question is, "what are commands?". |
00:43 | In simplest terms we can say that Linux commands are words that when keyed in cause some actions to take place. |
00:52 | Linux commands are seldom more than four character in length like ls, who, ps etc. |
00:59 | The commands are in "lower case" and they are "case sensitive". Let us see an example. |
01:05 | Go to the Applications menu. |
01:08 | Select Accessories and then click on Terminal from the available options. |
01:14 | or press Ctrl Alt t on your keyboard to open a terminal window. |
01:20 | Now we can see a prompt ($) and a cursor blinking next to it. This is where we need to type in a command. |
01:29 | Type in the words who and press Enter. |
01:34 | We can see the name of the users logged in. Actually we have just executed a command called who which shows "who are logged into" the system. |
01:47 | But which entity is converting these commands which are nothing more than a few letters into actions? |
01:54 | This is the job of the Command Interpreter, also called the shell. |
01:59 | We can define a shell as a program that acts as the interface between us and the Linux system, |
02:08 | allowing us to enter commands for the operating system to execute. |
02:13 | On Linux it’s quite feasible to have multiple shells installed, with different users able to pick the one they prefer. |
02:22 | On Linux, the standard shell that is always installed as /bin/sh is called bash, the GNU Bourne-Again SHell, from the GNU suite of tools. |
02:35 | The commands we would be covering in this tutorial are generic and can run on most of the Linux shells with slight variations. |
02:44 | Nevertheless, we would be using the bash as the shell for demonstration in this tutorial. |
02:51 | It is because bash is the most popular shell and portable to almost all UNIX. |
02:58 | Other shells include the Bourne shell which is the original Unix shell, C Shell and Korn shell |
03:08 | To see which shell we are using, |
03:11 | go to the terminal and type the command: echo space dollar in capital SHELL and press Enter. |
03:27 | Normally the output is /bin/bash which gives us the bash shell. |
03:34 | There are ways by which we can activate different shells. Those will be covered in an advanced tutorial. |
03:42 | Commands are actually files containing programs, often written in C. |
03:47 | These files are contained in directories. To find out where a command is stored, we can use the type command. |
03:55 | Type at the command prompt: typespace ps and press Enter. |
04:03 | This shows that ps is actually a file stored in the /bin directory. |
04:09 | When we key in a command at the command prompt, the shell searches for a file matching the command name in a list of directories. |
04:18 | If it is found, then the program corresponding to that file is executed, else a “command not found” error is given. |
04:27 | The list of directories searched is specified by the PATH variable, as we will see later. |
04:34 | For now, if we want to see this list, just type the command echo space dollar PATH |
04:44 | in capital and press Enter. |
04:52 | Talking of commands, there is one important thing that we need to know. |
04:57 | Linux commands are of two types: External commands and internal commands. |
05:02 | Now external commands are those which exist as separate files/programs. |
05:07 | Most commands in Linux are of this nature. But there are some commands whose implementation is written within the shell and they do not exist as separate files. |
05:18 | These are internal commands. |
05:20 | The echo command which we will see later, is in fact an internal command. |
05:25 | Go to the terminal and type at the command: |
05:33 | type space echo and press Enter. |
05:40 | The output shows echo is a shell built-in. |
05:43 | So instead of giving a file name it shows that the echo command's implementation is internal to the shell. So it is called internal command. |
05:56 | Another important thing which we need to understand is the structure of commands. |
06:01 | Commands can be of one word or multiple words, separated by white spaces. |
06:08 | In the second case the first word is the actual name of the command while the other words are the arguments. |
06:16 | Arguments can be options or expressions or file names. |
06:20 | A command can perform different tasks depending on the option specified. |
06:26 | They are generally preceded by a single or double minus sign(-), called short and long option, respectively. |
06:35 | Go to the terminal window and type the commands and see their outputs. |
06:40 | Type clear to clear the terminal window. |
06:44 | Then type ls and press Enter. |
06:49 | Again, type clear and press Enter. |
06:55 | Type ls space minus a (-a) and Enter. |
07:04 | Type clear to clear the terminal window. |
07:11 | Now type ls space minus minus all and press Enter. |
07:19 | Again, type clear to clear the terminal . |
07:23 | Now type ls space minus d (-d) and press Enter. |
07:32 | At this point, it is enough to understand how the command's behavior changes with change of options |
07:40 | In Linux we have a larger number of commands, |
07:45 | each of which have many different options. |
07:48 | Commands can also be combined together as we will see later. So how do we keep so much in mind? |
07:55 | In reality you don't have to. This is because of the excellent online help facility available in Linux. |
08:01 | The man command provides documentation on just about every available command on the system. |
08:08 | For instance, to know about say, the ls command, all you have to do is to go to the terminal |
08:16 | and type 'man' command with 'ls' as argument that is type: man space ls and press Enter. |
08:30 | Press q to come out. |
08:35 | man is the system’s manual pager. Each argument given to man is normally the name of a program, utility or function. |
08:43 | The manual page associated with each of these arguments is then found and displayed. |
08:49 | A section, if provided, will direct man to look only in that section of the manual. |
08:55 | The default is to search in all of the available sections, following a predefined order and to show only the first page found, even if page exists in several sections. |
09:07 | You can use man command to know more about the command man itself. |
09:14 | Go to the terminal and type: man space man and press Enter. |
09:23 | Press q to come out of it. |
09:26 | man command has many options. |
09:30 | Here, let me tell the most useful ones. Sometimes we know what we want to do but do not know the exact command. Then what can we do? |
09:41 | man provides the -k option which takes a keyword and returns a list of commands and their brief purpose. |
09:50 | For example, create a directory, we may not know the exact command, |
09:56 | so we can go to the command prompt and type man space minus k space directories and press Enter. |
10:12 | Now we can search each of these commands to see what we actually need. |
10:17 | The same thing can be achieved using apropos command. |
10:21 | Type at the command prompt: apropos space directories and press Enter to see the output. |
10:36 | Sometimes we do not need too much details. We only need to know what a command does. |
10:40 | In that case we can use the whatis command or man -f. Both give one line description about the command. |
10:52 | Go to the terminal, type clear to clear the terminal window. |
10:58 | Now type whatis space ls and press Enter. |
11:06 | Some commands have many options. We may want to obtain a list of the different options that a command has. |
11:13 | Then we use the minus help option. |
11:18 | Go to the command prompt and type: ls space minus minus help and press Enter. |
11:29 | I will scroll up so that you can see all the options on this manual page. |
11:45 | That's it for this part of the Linux Spoken tutorial. Spoken Tutorials are a part of the Talk to a Teacher project, supported by the National Mission on Education through ICT. |
11:56 | More information on the same is available at the following link . |
12:00 | This script has been contributed by ----------------------(name of the translator) and this is -----------------------(name of the recorder) from --------------------------(name of the place) signing off. Good bye. |