WEBVTT - This file was automatically generated by VIMEO

0
00:00:15.600 --> 00:00:18.400
Hello everyone and welcome to this lesson.

1
00:00:18.400 --> 00:00:21.300
 So in this video we are going to see some

2
00:00:21.300 --> 00:00:24.400
 more commands that is helpful in your day to

3
00:00:24.400 --> 00:00:27.500
 day routine of using Linux operating

4
00:00:27.500 --> 00:00:27.800
 system.

5
00:00:28.800 --> 00:00:31.500
So we have these files which have been created over

6
00:00:31.500 --> 00:00:34.100
 here. So let me show you

7
00:00:34.100 --> 00:00:37.200
 how we can use Touch command. So we

8
00:00:37.200 --> 00:00:40.200
 already know that using touch command. We

9
00:00:40.200 --> 00:00:43.500
 can make empty files. So let's say I type touch

10
00:00:43.500 --> 00:00:47.100
 XYZ so it is going to create empty

11
00:00:46.100 --> 00:00:50.000
 file, which is XY said now, let's suppose

12
00:00:49.300 --> 00:00:52.500
 I want to make 10 empty files.

13
00:00:53.400 --> 00:00:56.700
So for that I cannot write Touch 1 touch 2

14
00:00:56.700 --> 00:00:59.100
 3 4 5 or let's suppose

15
00:00:59.100 --> 00:01:02.500
 I want to make 100 files. I cannot every time

16
00:01:02.500 --> 00:01:06.000
 write Touch 1 touch 2 touch 3

17
00:01:05.500 --> 00:01:08.500
 touch 100 to make 100 mp

18
00:01:08.500 --> 00:01:11.400
 files for that. You can simply use the command touch

19
00:01:11.400 --> 00:01:14.800
 curly braces and one dot

20
00:01:14.800 --> 00:01:17.500
 dot 10. So this will create the

21
00:01:17.500 --> 00:01:21.100
 10 empty files. Let me show you our 10

22
00:01:20.100 --> 00:01:23.300
 files created over here and you can

23
00:01:23.300 --> 00:01:26.700
 see these are the files which have been created over

24
00:01:26.700 --> 00:01:26.900
 here.

25
00:01:27.700 --> 00:01:30.300
Now you can see over here. It did not

26
00:01:30.300 --> 00:01:33.900
 create one and two because it is already being

27
00:01:33.900 --> 00:01:36.300
 taken by these directories which

28
00:01:36.300 --> 00:01:37.900
 is one and two.

29
00:01:38.600 --> 00:01:42.100
So let's do LS hyphen all and you

30
00:01:41.100 --> 00:01:44.900
 can see over here one is directory

31
00:01:44.900 --> 00:01:47.600
 2 is directory 3

32
00:01:47.600 --> 00:01:50.600
 4 5 6 7 8 9 and 10

33
00:01:50.600 --> 00:01:51.800
 are files.

34
00:01:52.600 --> 00:01:55.700
File 1 and file 2 is again file and

35
00:01:55.700 --> 00:01:58.400
 this is a symbolic link which we have created

36
00:01:58.400 --> 00:02:01.300
 and XYZ again is

37
00:02:01.300 --> 00:02:04.300
 a file perfect. Let me clear the

38
00:02:04.300 --> 00:02:04.500
 screen.

39
00:02:05.300 --> 00:02:08.400
Now we have already seen how to read a file for

40
00:02:08.400 --> 00:02:11.500
 that. We use the command cat and the file name.

41
00:02:11.500 --> 00:02:14.500
 So let's read the file which is file to and here it

42
00:02:14.500 --> 00:02:17.700
 says this is file too. Now if

43
00:02:17.700 --> 00:02:20.300
 you want to browse through a text file, you

44
00:02:20.300 --> 00:02:23.800
 can also do that simply use the command less. So

45
00:02:23.800 --> 00:02:26.600
 let's type less file two

46
00:02:26.600 --> 00:02:29.100
 and hit enter and you can see

47
00:02:29.100 --> 00:02:33.000
 this is file to and it is the end of the file perfect.

48
00:02:32.400 --> 00:02:35.500
 So let's say if you want to see the first

49
00:02:35.500 --> 00:02:38.300
 10 lines of a file so for

50
00:02:38.300 --> 00:02:41.800
 that you can use the command head and file too. Now,

51
00:02:41.800 --> 00:02:44.200
 there is only one line. That is the reason you're

52
00:02:44.200 --> 00:02:47.600
 able to see only one line. So let's quickly create some

53
00:02:47.600 --> 00:02:49.900
 lines into this file and let's say

54
00:02:51.100 --> 00:02:53.600
This is first line.

55
00:02:55.600 --> 00:02:59.000
Enter and let's let's simply type

56
00:02:58.300 --> 00:03:02.000
 some random words over here. And let's

57
00:03:01.200 --> 00:03:05.200
 say this is the last

58
00:03:04.200 --> 00:03:07.100
 line. Let's quickly save it.

59
00:03:07.800 --> 00:03:10.100
And now we are going to use the command head.

60
00:03:11.200 --> 00:03:11.900
file to

61
00:03:12.700 --> 00:03:13.100
oops

62
00:03:14.200 --> 00:03:17.300
Head file to and you can see these are the first

63
00:03:17.300 --> 00:03:22.300
 10 lines. This is the first line second third fourth

64
00:03:20.300 --> 00:03:23.800
 fifth. This is

65
00:03:23.800 --> 00:03:26.700
 an empty line, which is sixth this is

66
00:03:26.700 --> 00:03:29.600
 seventh eight nine. And this

67
00:03:29.600 --> 00:03:32.800
 is the last one which is the tenth line. Now if

68
00:03:32.800 --> 00:03:35.500
 you want to do the similarly from the

69
00:03:35.500 --> 00:03:38.700
 bottom, so if you want to read the last 10 lines, you

70
00:03:38.700 --> 00:03:41.900
 can use the command tail file to hit

71
00:03:41.900 --> 00:03:44.300
 enter and you can see this is the last line

72
00:03:44.300 --> 00:03:47.800
 which is the Ten line eight seven, six

73
00:03:47.800 --> 00:03:50.600
 five four three two one. So this

74
00:03:50.600 --> 00:03:53.700
 way you can read the top of the document as

75
00:03:53.700 --> 00:03:56.000
 well as the bottom of the document.

76
00:03:56.900 --> 00:03:58.900
in case you want to read

77
00:03:59.900 --> 00:04:02.000
more than 10 lines simply you can

78
00:04:02.300 --> 00:04:05.500
 type head hyphen and how many lines you

79
00:04:05.500 --> 00:04:08.600
 want to read. So let's say you want to read 12 lines. So

80
00:04:08.600 --> 00:04:11.500
 head - 12 and the

81
00:04:11.500 --> 00:04:12.300
 file name.

82
00:04:13.200 --> 00:04:16.900
Here you can see this this command was head file

83
00:04:16.900 --> 00:04:19.800
 to and we could read the top 10

84
00:04:19.800 --> 00:04:22.700
 lines and it ended with SF. So

85
00:04:22.700 --> 00:04:25.500
 there should be two more lines 11th and

86
00:04:25.500 --> 00:04:28.900
 12th, which is DS and F. So this

87
00:04:28.900 --> 00:04:31.400
 way you can specify the number

88
00:04:31.400 --> 00:04:35.500
 of lines that you want to read with hyphen

89
00:04:34.500 --> 00:04:37.700
 and the number the count over

90
00:04:37.700 --> 00:04:38.000
 here.

91
00:04:38.700 --> 00:04:39.100
Perfect.

92
00:04:40.300 --> 00:04:43.500
Similarly you can do this with tail as well. So tail

93
00:04:43.500 --> 00:04:46.800
 hyphen 15 and the file

94
00:04:46.800 --> 00:04:49.600
 name. So the file name is file to hit enter

95
00:04:49.600 --> 00:04:52.500
 here. You saw we got a error because we

96
00:04:52.500 --> 00:04:56.100
 made a space over here. So let's Rectify

97
00:04:55.100 --> 00:04:56.300
 this.

98
00:04:57.100 --> 00:05:01.300
And here you can see we're able to see the last 15 lines

99
00:05:00.300 --> 00:05:01.900
 now.

100
00:05:02.800 --> 00:05:07.000
If you want to read a document in a PDF document

101
00:05:06.600 --> 00:05:09.600
 viewer type of mode simply you

102
00:05:09.600 --> 00:05:12.400
 can use the command which is more and the

103
00:05:12.400 --> 00:05:15.400
 file name here. You can see this looks

104
00:05:15.400 --> 00:05:18.600
 something like this and you

105
00:05:18.600 --> 00:05:21.700
 are able to read the file completely over

106
00:05:21.700 --> 00:05:23.800
 here. So I hope you guys understood.

107
00:05:25.200 --> 00:05:25.600
Thank you.
