BOSS-Linux/C2/General-Purpose-Utilities/English-timed

From Script | Spoken-Tutorial
Jump to: navigation, search
Time Narration
00:00 Hi, welcome to this spoken tutorial on General Purpose Utilities in Linux.
00:06 In this tutorial, we will make ourselves acquainted with some of the most basic yet heavily used commands of Linux.
00:14 The main motivation of this is to give you a head-start about working with Linux.
00:21 The first command that we will see is the echo command. However, note that linux commands are case sensitive.
00:29 Here, all commands and their options are in small letters unless otherwise mentioned.
00:36 This command is used to display some message on the screen. Switch to the terminal.
00:44 A general procedure to open a terminal is already explained in another spoken tutorial.
00:50 Type at the prompt: echo space Hello World and press Enter.
01:02 This prints the customary Hello World message on the screen.
01:06 We can also use the echo command to display the value of a variable.
01:11 Type at the prompt: echo space dollar SHELL in capital and press Enter.
01:22 This outputs the present shell being used.
01:28 We can also use escape sequences with echo command.
01:35 For this, in Linux we need to use the -e (hyphen e) option.
01:39 Common escape sequences include \t (backslash t) for tab, \n (backslash n) for new line and \c (backslash c) is a escape sequence which when used, causes the prompt to be displayed on the same line.
01:55 This can be useful if say we want a prompt message before entering something. Type at the prompt

echo space minus e within single quote Enter a command \c (backslash c) and press Enter.

02:25 We will see that the prompt will be displayed after printing Enter a command on the same line.
02:31 You may want to know what version of Linux Kernel you are running.
02:35 To know this and many other characteristics of our machine, we have the uname command. Type at the prompt: uname space hyphen r and press Enter.
02:51 To know what is your username, type at the prompt: who space am space I and press Enter.
03:03 This in fact comes from the who command that enlists all the users currently logged into the system, in case your system is a multi-user system.
03:14 Sometimes your login password may get compromised and/or you may want to change it.
03:20 For this, we have the passwd command. Type at the prompt: p a s s w d and press Enter.
03:30 When you type this command, you would be asked to type the current password.
03:35 Here, I would be typing my system's current password.
03:41 When that is correctly entered, you will have to enter your new password and then retype it to confirm.
03:55 But, what if we have forgotten our current password?
03:59 Then also the password can be changed without knowing the current password but that can only be done by the root user.
04:06 Now who is a root user?
04:10 He is a special user with extra privileges.
04:15 To draw an analogy, we can say a root user is similar to a user in Windows with Administrator status.
04:23 We may be interested in knowing the system date and time. For this we have the date command.
04:28 Type date in the terminal and press Enter.
04:34 It will show you the present system time and date.
04:38 As we can see, the date command gives both date and time. This is a very versatile utility and has many options as well.
04:47 Type at the prompt: date space plus  % (percentage sign) capital T and press Enter.
04:59 It gives us only the time in hours, minutes and seconds (hh:mm:ss) format.
05:05 Type at the prompt: date space plus %(percentage sign) small h and press Enter.
05:15 It gives the name of the month.
05:18 Type at the prompt: date space +%(plus percentage sign) small m and press Enter.
05:31 It gives the month of the year in numerical format. Here, it is showing 02 for the month of February . Match this according to the output you are getting.
05:42 Type at the prompt: date space +% (plus percentage sign) small y and press Enter.
05:53 It gives the last two digit of the current year.
05:58 We can combine these options as well. For example, type at the prompt: date space plus within double quotes percentage small h percentage small y and press Enter.
06:27 Here, it is showing February 11.
06:31 Another related command is the cal command. Though not as common, this helps you to see the calender of any month and any year.
06:41 To see the current month's calendar, type at the prompt: cal and press Enter.
06:48 To see the calendar of any arbitrary month- say December 2070, type at the prompt: cal space 12 space 2070 and press Enter.
07:05 This gives the calendar of December 2070.
07:11 Before moving ahead, let us discuss a little bit about files and directories.
07:19 In Linux, almost everything is a file. Now the question is what is a file?
07:26 In real file, a file is where we store our documents and papers. Similarly, a Linux file is a container for storing information.
07:40 Next, what is a directory?
07:44 A directory can be understood as a collection of files and other (sub)directories.
07:50 A directory helps us in organizing our files in a systematic manner .
07:56 This is like what we call folders in Windows.
08:01 When we login into the Linux system, we are by default in a home directory. To see the home directory, type at the prompt: echo space dollar HOME (in capital) and press Enter.
08:20 The next command helps us to see the directory we are currently working in. It is pwd, that stands for present working directory. Type at the prompt: pwd and press Enter.
08:35 Once we know of our directory, we would also want to know what are the files and sub-directories in that directory. For this, we have the "ls" command which is probably the most widely used command in Unix and Linux.
08:49 Type the command ls and press Enter.
08:54 Now observe the output.
08:56 Files and sub-directories are generally shown with different colours.
09:00 "ls" is a very versatile command and has many options. Let us see some of them. Type at the prompt: ls space minus minus all and press Enter.
09:17 This shows all the files including the hidden files. Hidden files here are file names starting with dot (.).
09:25 If we not only want to see the file but also get more information, we can use the "minus l" option.
09:33 Just type the command: ls space minus small l and press Enter.
09:43 It gives us the file permissions, file owner's name, last modification time, file size in bytes etc. Explanation of the fields of this option is beyond the scope of the present tutorial.
09:58 "ls" can be used with many options which we will see later.
10:03 Instead of just displaying all these information on the screen, we may store it in a file. In fact we can store the output of any command in a file in this way.
10:15 Just type the command followed by the right angle-bracket and the file name. Say- we write: ls space minus small l space right angle-bracket space fileinfo and press Enter.
10:39 Now, all the files and directories information will be directed into the file named "fileinfo".
10:46 But how do we see the content of this file? For this, we have the cat command. Just type: cat space and the name of the file, here it is "fileinfo", and press Enter.
11:04 Now, you can see its contents. In fact, the other main use of cat is to create a file. For this, type at the prompt: cat space right angle- bracket space filename say file1 and press Enter.
11:28 Now when we press Enter, the command waits for input from the user.
11:34 Whatever we type, would be written into the file; so type some text.
11:43 Now, press Enter key to indicate the end of input.
11:49 Now, press the Ctrl and D keys together.
11:58 If a file by name say "file1" already exists then the user input will be overwritten on this file.
12:06 Now, if you wish to append to the end of an existing file file1, type at the prompt: cat space double right- angle bracket space file1 and press Enter.
12:28 There are several other commands that we could have discussed but we would keep it to this for now. In fact, even for all the commands discussed, there are many options and possibilities untouched here.
12:43 This brings us to the end of this spoken tutorial. Spoken Tutorials are a part of the "Talk to a Teacher" project, supported by the National Mission on Education through ICT.
12:55 More information on the same is available at the following link .
13:02 This is Shambulingayya.N.D, signing off. Thanks for joining.

Contributors and Content Editors

PoojaMoolya, Sandhya.np14