Difference between revisions of "BOSS-Linux/C2/Simple-filters/English-timed"

From Script | Spoken-Tutorial
Jump to: navigation, search
Line 4: Line 4:
 
|-
 
|-
 
| 00:02
 
| 00:02
| Hello and welcome to the Spoken Tutorial on Simple Filters with Linux.  
+
| Hello and welcome to the '''Spoken Tutorial''' on '''Simple Filters''' with '''Linux'''.  
 
|-
 
|-
 
|00:09
 
|00:09
Line 10: Line 10:
 
|-
 
|-
 
| 00:18
 
| 00:18
| All these are command line text manipulation tools.  
+
| All these are '''command line text manipulation tool'''s.  
 
|-
 
|-
 
| 00:22
 
| 00:22
| If you see a hash (#) symbol on the Terminal you need to become root to execute those commands   
+
| If you see a hash (#) symbol on the Terminal, you need to become '''root''' to execute those commands.  
 
|-
 
|-
 
|00:29
 
|00:29
|'''sudo su''' or '''su root''', if you see a dollar symbol on the Terminal you can be an ordinary user to execute those commands.  
+
|'''sudo su''' or '''su root'''. If you see a dollar symbol on the Terminal, you can be an ordinary user to execute those commands.  
 
|-
 
|-
 
| 00:38
 
| 00:38
| I assume that you did a default installation and did not modify any path where the files are getting saved.  
+
| I assume that you did a default installation and did not modify any '''path''' where the files are getting saved.  
 
|-
 
|-
 
| 00:46
 
| 00:46
| I am using Linux for this tutorial.  
+
| I am using '''Linux''' for this tutorial.  
 
|-
 
|-
 
|00:51
 
|00:51
|Prerequisites for this module are the ability to use the mouse , keyboard, maximize and minimize buttons on a window.
+
|Prerequisites for this module are- the ability to use the '''mouse''' , keyboard, maximize and minimize buttons on a '''window'''.
 
|-
 
|-
 
|01:02
 
|01:02
| We use the '''Head''' command followed by an '''ascii''' file name, to display the first 10 lines of a file by default.  
+
| We use the '''Head''' command followed by an '''ascii''' file name, to display the first 10 lines of a file, by default.  
 
|-
 
|-
 
| 01:10
 
| 01:10
Line 37: Line 37:
 
|-
 
|-
 
| 01:20
 
| 01:20
|I already have these numbers in another file for the sake of time constrain .  
+
|I already have these numbers in another file for the sake of time constraint.  
 
|-
 
|-
 
| 01:26
 
| 01:26
Line 43: Line 43:
 
|-
 
|-
 
| 01:34
 
| 01:34
| Hit on '''File''' , '''Save.'''  
+
| Hit on '''File''', '''Save.'''  
 
|-
 
|-
 
| 01:37
 
| 01:37
|Name the file as '''numbers dot txt''' and hit on '''save'''  
+
|Name the file as '''numbers dot txt''' and hit on '''save'''.
 
|-
 
|-
 
| 01:44
 
| 01:44
Line 52: Line 52:
 
|-
 
|-
 
| 01:50
 
| 01:50
| Now go to '''Applications > Accessories > Terminal.'''  
+
| Now, go to '''Applications > Accessories > Terminal.'''  
 
|-
 
|-
 
| 01:58
 
| 01:58
Line 58: Line 58:
 
|-
 
|-
 
| 02:02
 
| 02:02
|Type '''ls''' and hit on '''enter.'''  
+
|Type '''ls''' and hit on '''Enter.'''  
 
|-
 
|-
 
| 02:05
 
| 02:05
Line 67: Line 67:
 
|-
 
|-
 
| 02:18
 
| 02:18
| '''Cat n-u-m''' Hit on '''tab''' to autofill the file name. Hit on '''Enter.'''
+
| '''Cat n-u-m'''. Hit on '''tab''' to auto-fill the file name. Hit on '''Enter.'''
 
|-
 
|-
 
| 02:26
 
| 02:26
Line 73: Line 73:
 
|-
 
|-
 
| 02:30
 
| 02:30
| '''head numbers dot txt''', '''enter'''
+
| '''head numbers dot txt''', '''Enter'''.
 
|-
 
|-
 
| 02:36
 
| 02:36
Line 79: Line 79:
 
|-
 
|-
 
| 02:39
 
| 02:39
| If we want to see the first 5 lines, use the option ''' hyphen n5''' in between the '''head''' command and the file.  
+
| If we want to see the first 5 lines, use the option ''' hyphen n5''' in between the '''head''' command and the file name.  
 
|-
 
|-
 
| 02:49
 
| 02:49
| Hit on Up arrow,  '''hyphen n5''' and '''Enter.'''
+
| Hit on Up-arrow,  '''hyphen n5''' and '''Enter.'''
 
|-
 
|-
 
| 02:55
 
| 02:55
Line 88: Line 88:
 
|-
 
|-
 
| 02:59
 
| 02:59
|Let us switch back to the presentation  
+
|Let us switch back to the presentation.
  
 
|-
 
|-
 
| 03:04
 
| 03:04
| The '''tail''' command works exactly opposite to the '''head''' command, it displays the last 10 lines of a file by default.
+
| The '''tail''' command works exactly opposite to the '''head''' command, it displays the last 10 lines of a file, by default.
 
|-
 
|-
 
| 03:12
 
| 03:12
| I am hitting on '''ALT''' and '''Tab''' to switch to the terminal.
+
| I am hitting on '''ALT''' and '''Tab''' to switch to the '''terminal'''.
 
|-
 
|-
 
| 03:17
 
| 03:17
Line 104: Line 104:
 
|-
 
|-
 
| 03:31
 
| 03:31
| '''hyphen n5''', '''Enter'''  
+
| '''hyphen n5''', '''Enter'''.
 
|-
 
|-
 
| 03:36
 
| 03:36
| Switch to slides
+
| Switch to slides.
 
|-
 
|-
 
| 03:39
 
| 03:39
Line 116: Line 116:
 
|-
 
|-
 
| 03:51
 
| 03:51
| The most useful option of the tail command is to use '''hyphen f''' option to follow the tail of a log file.  
+
| The most useful option of the '''tail''' command is to use '''hyphen f''' option to follow the '''tail''' of a log file.  
 
|-
 
|-
 
| 03:59
 
| 03:59
|If a new line is appended to the log file, the '''tail''' command will take that as the last line and display 10 lines by default above it.  
+
|If a new line is appended to the log file, the '''tail''' command will take that as the last line and display 10 lines, by default, above it.  
 
|-
 
|-
 
| 04:09
 
| 04:09
| Go to the terminal
+
| Go to the '''terminal'''.
 
|-
 
|-
 
| 04:11
 
| 04:11
|'''tail hyphen f forward slash var slash log slash auth dot log'''
+
|'''tail hyphen f forward slash var slash log slash auth dot log'''.
 
|-
 
|-
 
| 04:21
 
| 04:21
| Let me resize this terminal
+
| Let me resize this terminal.
 
|-
 
|-
 
| 04:28
 
| 04:28
| Let us open another Terminal , '''Application- > Accessories - > Terminal.'''
+
| Let us open another Terminal, '''Application -> Accessories -> Terminal.'''
 
|-
 
|-
 
| 04:36
 
| 04:36
Line 140: Line 140:
 
|-
 
|-
 
| 04:50
 
| 04:50
| Try to '''su''' as yourself, hit on '''enter.'''  
+
| Try to '''su''' as yourself, hit on '''Enter.'''  
 
|-
 
|-
 
| 04:54
 
| 04:54
| Give in some wrong password hit on '''enter.'''
+
| Give in some wrong password hit on '''Enter.'''
 
|-
 
|-
 
| 04:58
 
| 04:58
Line 152: Line 152:
 
|-
 
|-
 
| 05:13
 
| 05:13
| Type '''date''' hit on '''enter''' to verify the system date and time.
+
| Type '''date''', hit on '''Enter''' to verify the system date and time.
 
|-
 
|-
 
| 05:22
 
| 05:22
Line 164: Line 164:
 
|-
 
|-
 
| 05:47
 
| 05:47
|These are the commonly used log files in Linux.  
+
|These are the commonly used '''log file'''s in Linux.  
 
|-
 
|-
 
| 05:51
 
| 05:51
| A linux system administrator will look into these log files for more information to troubleshoot his machine if there is a problem.
+
| A '''Linux system administrator''' will look into these log files for more information to troubleshoot his machine if there is a problem.
 
|-
 
|-
 
| 06:02
 
| 06:02
| '''Sort''' command as the name suggest will sort a file for us in both ascending and descending order.  
+
| '''"Sort"''' command, as the name suggests, will sort a file for us in both ascending and descending order.  
 
|-
 
|-
 
| 06:13
 
| 06:13
| '''sort numbers dot txt''' .This would sort our '''numbers dot txt''' file in ascending order.  
+
| '''sort numbers dot txt'''. This would sort our '''numbers dot txt''' file in ascending order.  
 
|-
 
|-
 
| 06:21
 
| 06:21
| Notice something is strange in there, sort just looks at the first character to sort, so '''10''','''11'''&'''12''' appears before the number 2.  
+
| Notice something is strange in there, '''sort''' just looks at the first character to sort, so '''10''', '''11''' & '''12''' appear before the number 2.  
 
|-
 
|-
 
| 06:33
 
| 06:33
| To avoid this add the option of '''hyphen n''', hyphen n and  Enter
+
| To avoid this, add the option of '''-n''' hyphen n and  Enter.
 
|-
 
|-
 
| 06:43
 
| 06:43
| Now sort looks at the entire number to sort them.  
+
| Now, sort looks at the entire number to sort them.  
 
|-
 
|-
 
| 06:47
 
| 06:47
| To sort '''number dot txt''' in reverse order add an option of '''hyphen r.'''  
+
| To sort '''number dot txt''' in reverse order, add an option of '''hyphen r.'''  
 
|-
 
|-
 
| 06:59
 
| 06:59
| We have numbers that repeat in this file, to pull out just the unique numbers add another option of '''hyphen u''' .
+
| We have numbers that repeat in this file; to pull out just the unique numbers, add another option of '''hyphen u'''.
 
|-
 
|-
 
| 07:07
 
| 07:07
Line 194: Line 194:
 
|-
 
|-
 
|07:09
 
|07:09
| Up Arrow  
+
| Up-Arrow.
 
|-
 
|-
 
| 07:11
 
| 07:11
|'''U,  enter''',  
+
|'''U,  Enter''',  
 
|-
 
|-
 
| 07:15
 
| 07:15
|Previously two 2's were displayed . Now only one 2 is displayed.
+
|Previously two 2's were displayed. Now only one 2 is displayed.
 
|-
 
|-
 
| 07:28
 
| 07:28
Line 212: Line 212:
 
|-
 
|-
 
| 07:46
 
| 07:46
| I already have the data in another file for the sake of time constrain let me copy & Paste the value, '''CTRL+C; CTRL+V.'''  
+
| I already have the data in another file for the sake of time constraint. Let me copy & Paste the value, '''CTRL+C; CTRL+V.'''  
 
|-
 
|-
 
| 08:01
 
| 08:01
Line 218: Line 218:
 
|-
 
|-
 
| 08:11
 
| 08:11
| Don't mind the special characters on this file I don't want someone to sue me for giving them low marks  
+
| Don't mind the special characters on this file. I don't want someone to sue me for giving them low marks.
 
|-
 
|-
 
| 08:18
 
| 08:18
Line 224: Line 224:
 
|-
 
|-
 
| 08:24
 
| 08:24
| Let us sort based on the second column of '''marks dot txt file. '''
+
| Let us sort based on the second column of '''marks dot txt file.'''
 
|-
 
|-
 
| 08:30
 
| 08:30
Line 230: Line 230:
 
|-
 
|-
 
| 08:32
 
| 08:32
|'''sort space marks dot txt space hyphen t space open inverted commas space close inverted commas space'''
+
|'''sort space marks dot txt space hyphen t space open inverted commas space close inverted commas space'''.
 
|-
 
|-
 
| 08:43
 
| 08:43
|here '''hyphen t''' stands for the '''delimiter''' & the space in between the quotes represents it.  
+
|Here, '''hyphen t''' stands for the '''delimiter''' & the space in between the quotes represents it.  
 
|-
 
|-
 
| 08:52
 
| 08:52
|'''hyphen k2''' for the second column on which sort should be performed.
+
|'''hyphen k2''' for the second column on which '''sort''' should be performed.
 
|-
 
|-
 
| 09:04
 
| 09:04
Line 242: Line 242:
 
|-
 
|-
 
| 09:10
 
| 09:10
|'''Cat marks dot txt'''  
+
|'''Cat marks dot txt'''.
 
|-
 
|-
 
| 09:14
 
| 09:14
Line 251: Line 251:
 
|-
 
|-
 
| 09:41
 
| 09:41
|Let us pull out the names from '''marks dot txt'''  
+
|Let us pull out the names from '''marks dot txt'''.
 
|-
 
|-
 
| 09:44
 
| 09:44
|Let us go to the terminal '''ALT Tab'''  
+
|Let us go to the terminal '''ALT Tab'''.
 
|-
 
|-
 
| 09:48
 
| 09:48
Line 260: Line 260:
 
|-
 
|-
 
|09:58
 
|09:58
|here in '''cut''' command '''d''' is the delimiter & the space in between the quotes represents the delimiter.
+
|Here in '''cut''' command, 'd' is the delimiter & the space in between the quotes represents the delimiter.
 
|-
 
|-
 
|10:10
 
|10:10
|'''hyphen f2''' for the second column. Hit on '''enter.'''  
+
|'''hyphen f2''' for the second column. Hit on '''Enter.'''  
 
|-
 
|-
 
|10:21
 
|10:21
Line 275: Line 275:
 
|-
 
|-
 
|10:33
 
|10:33
|'''Paste numbers dot txt  marks dot txt''', '''enter'''
+
|'''Paste numbers dot txt  marks dot txt''', '''Enter'''.
 
|-
 
|-
 
|10:40
 
|10:40
|Now the first line of '''marks dot txt''' was appended to the first line of '''numbers dot txt.'''  
+
|Now, the first line of '''marks dot txt''' was appended to the first line of '''numbers dot txt.'''  
 
|-
 
|-
 
|10:47
 
|10:47
Line 287: Line 287:
 
|-
 
|-
 
| 10:58
 
| 10:58
| Hit on Up arrow. Hit on the redirect key which is the Greater than symbol '''concatfile dot txt'''. Hit on '''Enter.'''  
+
| Hit on Up-arrow. Hit on the redirect key which is the Greater than symbol '''concatfile dot txt'''. Hit on '''Enter.'''  
 
|-
 
|-
 
| 11:07
 
| 11:07
| '''Cat concatfile dot txt'''  
+
| '''Cat concatfile dot txt'''.
 
|-
 
|-
 
| 11:12
 
| 11:12
Line 296: Line 296:
 
|-
 
|-
 
| 11:15
 
| 11:15
| If we want paste to print out the numbers serially delimited with tab we can use the '''hyphen s''' option.  
+
| If we want '''paste''' to print out the numbers serially delimited with tab, we can use the '''hyphen s''' option.  
 
|-
 
|-
 
| 11:25
 
| 11:25
Line 308: Line 308:
 
|-
 
|-
 
| 11:34
 
| 11:34
| Spoken Tutorial project is a part of Talk to a Teacher project,  
+
| '''Spoken Tutorial''' project is a part of '''Talk to a Teacher''' project,  
 
|-
 
|-
 
|11:39
 
|11:39
|Supported by the National Mission on Education through ICT,MHRD, Government of India.
+
|supported by the National Mission on Education through ICT,MHRD, Government of India.
 
|-
 
|-
 
| 11:45
 
| 11:45
| For more information you can refer to the following link.
+
| For more information, you can refer to the following link.
 
|-
 
|-
 
|11:48
 
|11:48
|This is Bala. Thanks a lot for watching this video and dont forget to leave a comment.
+
|This is Bala. Thanks a lot for watching this video and don't forget to leave a comment.
 
|}
 
|}

Revision as of 18:00, 12 August 2015

Time Narration
00:02 Hello and welcome to the Spoken Tutorial on Simple Filters with Linux.
00:09 Here we will be learning about head, Tail, sort, cut and paste.
00:18 All these are command line text manipulation tools.
00:22 If you see a hash (#) symbol on the Terminal, you need to become root to execute those commands.
00:29 sudo su or su root. If you see a dollar symbol on the Terminal, you can be an ordinary user to execute those commands.
00:38 I assume that you did a default installation and did not modify any path where the files are getting saved.
00:46 I am using Linux for this tutorial.
00:51 Prerequisites for this module are- the ability to use the mouse , keyboard, maximize and minimize buttons on a window.
01:02 We use the Head command followed by an ascii file name, to display the first 10 lines of a file, by default.
01:10 Let us create a file.
01:13 Go to Applications > Accessories > Text Editor.
01:20 I already have these numbers in another file for the sake of time constraint.
01:26 Let me copy and paste.
01:34 Hit on File, Save.
01:37 Name the file as numbers dot txt and hit on save.
01:44 Close this file.
01:50 Now, go to Applications > Accessories > Terminal.
01:58 Let us try to see if we can see the file we created.
02:02 Type ls and hit on Enter.
02:05 What we did here is to list all the folders and files on our home directory.
02:11 Now we can use the cat command to read the contents of the file we created.
02:18 Cat n-u-m. Hit on tab to auto-fill the file name. Hit on Enter.
02:26 Let us do the same with head command.
02:30 head numbers dot txt, Enter.
02:36 Now the first 10 lines are displayed.
02:39 If we want to see the first 5 lines, use the option hyphen n5 in between the head command and the file name.
02:49 Hit on Up-arrow, hyphen n5 and Enter.
02:55 Now the first 5 lines alone are displayed.
02:59 Let us switch back to the presentation.
03:04 The tail command works exactly opposite to the head command, it displays the last 10 lines of a file, by default.
03:12 I am hitting on ALT and Tab to switch to the terminal.
03:17 tail numbers dot txt
03:21 If we want to see just the last 5 lines, use the option hyphen n5 in between the tail command and the file name.
03:31 hyphen n5, Enter.
03:36 Switch to slides.
03:39 A log file contains events which took place in a system.
03:45 Auth dot log file maintains log's for who logged in & who logged out.
03:51 The most useful option of the tail command is to use hyphen f option to follow the tail of a log file.
03:59 If a new line is appended to the log file, the tail command will take that as the last line and display 10 lines, by default, above it.
04:09 Go to the terminal.
04:11 tail hyphen f forward slash var slash log slash auth dot log.
04:21 Let me resize this terminal.
04:28 Let us open another Terminal, Application -> Accessories -> Terminal.
04:36 Let me resize this terminal
04:42 so that I can show you in a single screen how tail follows the last line in a log file.
04:50 Try to su as yourself, hit on Enter.
04:54 Give in some wrong password hit on Enter.
04:58 You will see that the terminal on which tail is running is appended with a new log.
05:05 The date & time specifies when the authentication failure took place.
05:13 Type date, hit on Enter to verify the system date and time.
05:22 Type Exit to close this terminal.
05:26 Hit CTRL C to close the running tail command & maximize the screen.
05:42 We have seen only auth dot log file in the previous example.
05:47 These are the commonly used log files in Linux.
05:51 A Linux system administrator will look into these log files for more information to troubleshoot his machine if there is a problem.
06:02 "Sort" command, as the name suggests, will sort a file for us in both ascending and descending order.
06:13 sort numbers dot txt. This would sort our numbers dot txt file in ascending order.
06:21 Notice something is strange in there, sort just looks at the first character to sort, so 10, 11 & 12 appear before the number 2.
06:33 To avoid this, add the option of -n hyphen n and Enter.
06:43 Now, sort looks at the entire number to sort them.
06:47 To sort number dot txt in reverse order, add an option of hyphen r.
06:59 We have numbers that repeat in this file; to pull out just the unique numbers, add another option of hyphen u.
07:07 Go to Terminal.
07:09 Up-Arrow.
07:11 U, Enter,
07:15 Previously two 2's were displayed. Now only one 2 is displayed.
07:28 Now we will see how we can sort a file based on certain column.
07:33 Let us create a file and key in these as shown below.
07:38 Go to Applications > Accessories > Text Editor.
07:46 I already have the data in another file for the sake of time constraint. Let me copy & Paste the value, CTRL+C; CTRL+V.
08:01 File, Save it as marks dot txt, Hit on Save.
08:11 Don't mind the special characters on this file. I don't want someone to sue me for giving them low marks.
08:18 Close this file.
08:24 Let us sort based on the second column of marks dot txt file.
08:30 Go to the terminal.
08:32 sort space marks dot txt space hyphen t space open inverted commas space close inverted commas space.
08:43 Here, hyphen t stands for the delimiter & the space in between the quotes represents it.
08:52 hyphen k2 for the second column on which sort should be performed.
09:04 Hit on Enter.
09:10 Cat marks dot txt.
09:14 This is the original file, if you see Avir is moved above and Bala came below when we sorted based on the second column alone.
09:33 Cut command is used to cut just certain information from a file.
09:41 Let us pull out the names from marks dot txt.
09:44 Let us go to the terminal ALT Tab.
09:48 cut space marks dot txt space hyphen d space open inverted commas space close inverted commas space.
09:58 Here in cut command, 'd' is the delimiter & the space in between the quotes represents the delimiter.
10:10 hyphen f2 for the second column. Hit on Enter.
10:21 Paste command will merge corresponding subsequent lines of the files.
10:26 Let us use both the numbers dot txt and marks dot txt file now.
10:31 Go to the terminal.
10:33 Paste numbers dot txt marks dot txt, Enter.
10:40 Now, the first line of marks dot txt was appended to the first line of numbers dot txt.
10:47 We can use the redirect key to redirect this output to some other file called concatefile dot txt.
10:56 Go to the terminal.
10:58 Hit on Up-arrow. Hit on the redirect key which is the Greater than symbol concatfile dot txt. Hit on Enter.
11:07 Cat concatfile dot txt.
11:12 Let us go to the slide.
11:15 If we want paste to print out the numbers serially delimited with tab, we can use the hyphen s option.
11:25 Paste hyphen s
11:29 numbers dot txt
11:33 Go to the slide.
11:34 Spoken Tutorial project is a part of Talk to a Teacher project,
11:39 supported by the National Mission on Education through ICT,MHRD, Government of India.
11:45 For more information, you can refer to the following link.
11:48 This is Bala. Thanks a lot for watching this video and don't forget to leave a comment.

Contributors and Content Editors

PoojaMoolya, Pratik kamble, Sandhya.np14