1
00:00:02,150 --> 00:00:05,150
Hello, everyone, and welcome to this lesson.

2
00:00:05,300 --> 00:00:13,130
So in this video are going to see some more commands that is helpful in your day to day routine of using

3
00:00:13,130 --> 00:00:14,720
Linux operating system.

4
00:00:15,050 --> 00:00:18,740
So we have these files which have been created over here.

5
00:00:18,800 --> 00:00:23,090
So let me show you how we can use touch command.

6
00:00:23,360 --> 00:00:28,240
So we already know that using touch command we can make empty files.

7
00:00:28,250 --> 00:00:31,360
So let's say I type touch X, Y, Z.

8
00:00:31,370 --> 00:00:34,970
So it is going to create an empty file which is x, y, z.

9
00:00:35,210 --> 00:00:39,260
Now let's suppose I want to make ten empty files.

10
00:00:39,890 --> 00:00:44,880
So for that, I cannot write touch one, touch two, three, four or five.

11
00:00:44,900 --> 00:00:47,780
Well, let's suppose I want to make 100 files.

12
00:00:47,780 --> 00:00:49,070
I cannot every time.

13
00:00:49,070 --> 00:00:49,670
Right.

14
00:00:49,970 --> 00:00:52,640
Touch one, touch to touch three.

15
00:00:52,670 --> 00:00:55,430
Touch 100 to make 100 empty files.

16
00:00:55,610 --> 00:01:01,910
For that, you can simply use the command, touch, curly braces and 1.. ten.

17
00:01:02,090 --> 00:01:05,310
So this will create the ten empty files.

18
00:01:05,330 --> 00:01:09,080
Let me show you our ten files created over here.

19
00:01:09,080 --> 00:01:13,700
And you can see these are the files which have been created over here.

20
00:01:14,270 --> 00:01:21,890
Now, you can see over here it did not create one and two because it is already being taken by these

21
00:01:21,890 --> 00:01:24,710
directories, which is one and two.

22
00:01:24,920 --> 00:01:34,850
So let's do ls hyphen all and you can see over here one is directory, two is directory three, four,

23
00:01:34,850 --> 00:01:38,600
five, six, seven, eight, nine and ten are files.

24
00:01:39,050 --> 00:01:41,860
File one and file two is again file.

25
00:01:41,870 --> 00:01:48,860
And this is a symbolic link which we have created and XYZ it again is a file.

26
00:01:48,890 --> 00:01:49,610
Perfect.

27
00:01:49,880 --> 00:01:51,200
Let me clear the screen.

28
00:01:51,990 --> 00:01:55,140
Now we have already seen how to read a file for that.

29
00:01:55,140 --> 00:01:57,870
We use the command cat and the file name.

30
00:01:57,870 --> 00:02:00,060
So let's read the file which is file two.

31
00:02:00,060 --> 00:02:03,120
And here it says this is file two.

32
00:02:03,330 --> 00:02:07,980
Now if you want to browse through a text file, you can also do that.

33
00:02:08,010 --> 00:02:10,050
Simply use the command less.

34
00:02:10,050 --> 00:02:14,460
So let's type less file two and hit enter.

35
00:02:14,580 --> 00:02:18,900
And you can see this is file two and it is the end of the file.

36
00:02:19,170 --> 00:02:19,860
Perfect.

37
00:02:20,100 --> 00:02:25,860
So let's say if you want to see the first ten lines of a file, so for that you can use the command

38
00:02:25,860 --> 00:02:27,780
head and file two.

39
00:02:28,050 --> 00:02:29,550
Now there is only one line.

40
00:02:29,550 --> 00:02:32,490
That is the reason you are able to see only one line.

41
00:02:32,490 --> 00:02:44,750
So let's quickly create some lines into this file and let's say this is first line enter and let's let's

42
00:02:44,970 --> 00:02:53,910
simply type some random words over here and let's say this is the last line, let's quickly save it.

43
00:02:54,210 --> 00:02:59,850
And now we are going to use the command head file to oops.

44
00:03:00,760 --> 00:03:02,100
Had filed two.

45
00:03:02,110 --> 00:03:04,710
And you can see these are the first ten lines.

46
00:03:04,720 --> 00:03:06,140
This is the first line.

47
00:03:06,160 --> 00:03:09,700
Second, third, fourth, fifth.

48
00:03:09,940 --> 00:03:12,430
This is an empty line, which is sixth.

49
00:03:12,550 --> 00:03:15,460
This is seventh, eight, nine.

50
00:03:15,610 --> 00:03:18,230
And this is the last one, which is the 10th line.

51
00:03:18,250 --> 00:03:25,090
Now, if you want to do this similarly from the bottom, so if you want to read the last ten lines,

52
00:03:25,090 --> 00:03:29,170
you can use the command tail file to hit enter.

53
00:03:29,170 --> 00:03:34,750
And you can see this is the last line, which is the 10th line nine line eight, seven, six, five,

54
00:03:34,750 --> 00:03:36,630
four, three, two, one.

55
00:03:36,640 --> 00:03:43,030
So this way you can read the top of the document as well as the bottom of the document.

56
00:03:43,330 --> 00:03:47,980
In case you want to read more than ten lines.

57
00:03:48,010 --> 00:03:52,620
Simply, you can type, head, hyphen and how many lines you want to read.

58
00:03:52,630 --> 00:03:54,940
So let's say you want to read 12 lines.

59
00:03:54,940 --> 00:04:04,960
So head, hyphen 12 and the file name you can see this, this command was had file two and we could

60
00:04:04,960 --> 00:04:08,980
read the top ten lines and it ended with as F.

61
00:04:08,980 --> 00:04:10,990
So there should be two more lines.

62
00:04:11,260 --> 00:04:14,560
11th and 12th, which is D's and F.

63
00:04:14,560 --> 00:04:23,320
So this way you can specify the number of lines that you want to read with hyphen and the number.

64
00:04:23,320 --> 00:04:24,820
The count over here.

65
00:04:25,210 --> 00:04:25,870
Perfect.

66
00:04:26,680 --> 00:04:29,410
Similarly, you can do this with Taylorsville.

67
00:04:29,410 --> 00:04:33,400
So tail hyphen 15 and the final name.

68
00:04:33,400 --> 00:04:37,120
So the final name is file to hit enter here.

69
00:04:37,120 --> 00:04:40,750
You saw we got an error because we made a space over here.

70
00:04:40,750 --> 00:04:43,240
So let's rectify this.

71
00:04:43,570 --> 00:04:48,150
And here you can see we're able to see the last 15 lines.

72
00:04:48,160 --> 00:04:56,590
Now, if you want to read a document in a PDF document viewer type of mode, simply you can use the

73
00:04:56,590 --> 00:05:05,650
command which is more and the file name here you can see this looks something like this and you are

74
00:05:05,650 --> 00:05:08,680
able to read the file completely over here.

75
00:05:09,040 --> 00:05:10,570
So I hope you guys understood.

76
00:05:11,800 --> 00:05:12,520
Thank you.
