BOSS-Linux/C2/Basic-Commands/English-timed
From Script | Spoken-Tutorial
Revision as of 12:28, 4 December 2014 by PoojaMoolya (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 Linux Operating System |
| 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:51 | 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 | Now we can see a prompt ($) and a cursor blinking next to it. This is where we need to type in a command. |
| 01:22 | Type in the words who and press enter. |
| 01:28 | 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:41 | But which entity is converting these commands which are nothing more than a few letters into actions? |
| 01:47 | This is the job of the Command Interpreter, also called the shell. |
| 01:53 | We can define a shell as a program that acts as the interface between us and the Linux system, |
| 02:02 | allowing us to enter commands for the operating system to execute. |
| 02:07 | On Linux it’s quite feasible to have multiple shells installed, with different users able to pick the one they prefer. |
| 02:16 | 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:29 | The commands we would be covering in this tutorial are generic and can run on most of the Linux shells with slight variations. |
| 02:38 | Nevertheless, we would be using the bash as the shell for demonstration in this tutorial. |
| 02:44 | It is because bash is the most popular shell and portable to almost all UNIX. |
| 02:52 | Other shells include the Bourne shell which is the original Unix shell, C Shell and Korn shell |
| 03:02 | To see which shell we are using, go to the terminal |
| 03:08 | and type the command echo space dollar in capital SHELL and press enter |
| 03:21 | Normally the output is /bin/bash which gives us the bash shell. |
| 03:28 | There are ways by which we can activate different shells. Those will be covered in an advanced tutorial. |
| 03:36 | Commands are actually files containing programs, often written in C. |
| 03:41 | These files are contained in directories. To find out where a command is stored, we can use the type command. |
| 03:48 | Type at the command prompt, type space ps and press enter. |
| 03:58 | This shows that ps is actually a file stored in the /bin directory. |
| 04:03 | 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:12 | If it is found, then the program corresponding to that file is executed, else a “command not found” error is given. |
| 04:21 | The list of directories searched is specified by the PATH variable, as we will see later. |
| 04:28 | For now, if we want to see this list, just type the command echo space dollar PATH in capital |
| 04:40 | and press enter |
| 04:45 | Talking of commands, there is one important thing that we need to know. |
| 04:51 | Linux commands are of two types: External commands and internal commands. |
| 04:56 | Now external commands are those which exist as separate files/programs. |
| 05:00 | 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:12 | These are internal commands. |
| 05:14 | The echo command, which we will see later, is in fact an internal command. |
| 05:18 | Go to the terminal and type at the command, |
| 05:26 | type space echo and press enter. |
| 05:34 | The output shows echo as 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:50 | Another important thing which we need to understand is the structure of commands. |
| 05:55 | Commands can be of one word or multiple words, separated by white spaces. |
| 06:02 | In the second case the first word is the actual name of the command while the other words are the arguments. |
| 06:09 | Arguments can be options or expressions or file names. |
| 06:14 | A command can perform different tasks depending on the option specified. |
| 06:20 | They are generally preceded by a single or double minus sign, called short and long option, respectively. |
| 06:28 | Go to the terminal window and type the commands and see their outputs. |
| 06:34 | Type clear to clear the terminal window |
| 06:37 | Then type ls and press enter |
| 06:43 | Again, type clear and press enter |
| 06:49 | Type ls space minus a and enter. |
| 06:58 | Type clear to clear the terminal window |
| 07:04 | Now type ls space minus minus all and press enter. |
| 07:13 | Again, type clear to clear the terminal . |
| 07:18 | Now type ls space minus d and press enter. |
| 07:26 | At this point it is enough to understand how the command's behavior changes with change of options |
| 07:33 | In Linux we have a larger number of commands, |
| 07:39 | each of which have many different options. |
| 07:42 | Commands can also be combined together as we will see later. So how do we keep so much in mind? |
| 07:48 | In reality you don't have to. This is because of the excellent online help facility available in Linux. |
| 07:55 | The man command provides documentation on just about every available command on the system. |
| 08:01 | For instance, to know about say, the ls command, all you have to do is to go to the terminal |
| 08:09 | and type man command with ls as argument that is type man space ls and press enter |
| 08:23 | Press q to come out. |
| 08:29 | man is the system’s manual pager. Each argument given to man is normally the name of a program, utility or function. |
| 08:37 | The manual page associated with each of these arguments is then found and displayed. |
| 08:43 | A section, if provided, will direct man to look only in that section of the manual. |
| 08:49 | The default is to search in all of the available sections, following a pre-defined order and to show only the first page found, even if page exists in several sections. |
| 09:00 | You can use man command to know more about the command man itself. |
| 09:07 | Go to the terminal and type man space man and press enter. |
| 09:16 | Press q to come out of it. |
| 09:20 | man command has many options. |
| 09:23 | 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:35 | man provides the -k option which takes a keyword and return a list of commands and their brief purpose. |
| 09:44 | For example, create a directory, we may not know the exact command, |
| 09:50 | so we can go to the command prompt and type man space minus k space directories and press enter. |
| 10:06 | Now we can search each of these commands to see what we actually need. |
| 10:11 | The same thing can be achieved using apropos command. |
| 10:15 | Type at the command prompt apropos space directories and press enter to see the output. |
| 10:29 | Some times we do not need too much details. We only need to know what a command does. |
| 10:35 | In that case we can use the whatis command or man -f. Both give one line description about the command. |
| 10:45 | Go to the terminal, type clear to clear the terminal window |
| 10:51 | now type whatis space ls and press enter |
| 10:59 | Some commands have many options. We may want to obtain a list of the different options that a command has. |
| 11:07 | Then we use the - - (minus minus) help option. |
| 11:12 | Go to the command prompt and type ls space - -(minus minus) help and press enter |
| 11:23 | I will scroll up so that you can see all the options on this manual page |
| 11:38 | Thats 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:49 | More information on the same is available at the following link . |
| 11:54 | Thanks for joining us. This is Anuradha Amrutkar signing off. Good Bye. |