1
00:00:00,000 --> 00:00:01,710
Linux has many different ways

2
00:00:01,710 --> 00:00:04,560
of accessing documentation that will help you go through

3
00:00:04,560 --> 00:00:07,770
and understand all the key functions of Linux.

4
00:00:07,770 --> 00:00:09,810
Now, there's online help,

5
00:00:09,810 --> 00:00:13,080
there's FAQs, mailing lists,

6
00:00:13,080 --> 00:00:16,920
there's also manual pages inside of Linux itself.

7
00:00:16,920 --> 00:00:20,460
Today we're going to focus a lot on the manual function

8
00:00:20,460 --> 00:00:23,190
and we're also going to use an example

9
00:00:23,190 --> 00:00:24,750
to have a test case

10
00:00:24,750 --> 00:00:27,813
to get the best option for our organization.

11
00:00:29,700 --> 00:00:31,260
The first command we're going to test out

12
00:00:31,260 --> 00:00:33,420
is the apropos command.

13
00:00:33,420 --> 00:00:35,700
Now, the purpose of the apropos command

14
00:00:35,700 --> 00:00:40,680
is to allow the user to search through all the manuals

15
00:00:40,680 --> 00:00:43,110
for a keyword and a description

16
00:00:43,110 --> 00:00:46,320
or synopsis of a manual.

17
00:00:46,320 --> 00:00:47,153
For example,

18
00:00:48,030 --> 00:00:50,163
you use apropos search.

19
00:00:53,010 --> 00:00:54,330
Now, if you look at the results here,

20
00:00:54,330 --> 00:00:58,110
you will see that the apropos command uses the search

21
00:00:58,110 --> 00:01:00,570
and it parses through all of the commands

22
00:01:00,570 --> 00:01:03,120
that can potentially use a search function.

23
00:01:03,120 --> 00:01:06,210
And it gives us a list to the left of the commands

24
00:01:06,210 --> 00:01:07,920
and the descriptions to the right,

25
00:01:07,920 --> 00:01:11,580
that allows us to pretty much do a search function.

26
00:01:11,580 --> 00:01:13,920
Now again, Linux is very complex,

27
00:01:13,920 --> 00:01:15,480
and it can get very in-depth

28
00:01:15,480 --> 00:01:17,310
with a lot of different search features

29
00:01:17,310 --> 00:01:18,840
tailored to our organizations

30
00:01:18,840 --> 00:01:21,270
or what us, as Systems Administrators, need to do,

31
00:01:21,270 --> 00:01:23,403
and try to get the best results for us.

32
00:01:24,510 --> 00:01:27,000
Now, another example we're going to use

33
00:01:27,000 --> 00:01:28,620
is one that uses the apropos,

34
00:01:28,620 --> 00:01:30,420
but this time I'm going to use pattern.

35
00:01:33,000 --> 00:01:36,930
Now, we see we also have another set of commands

36
00:01:36,930 --> 00:01:38,670
that could search for patterns

37
00:01:38,670 --> 00:01:41,250
within, just say, file contents or logs.

38
00:01:41,250 --> 00:01:44,913
It's going to be very useful for us as Systems Administrators.

39
00:01:45,960 --> 00:01:48,930
Now, for this example, we're going to use grep.

40
00:01:48,930 --> 00:01:50,970
We're going to focus a lot on the grep command,

41
00:01:50,970 --> 00:01:53,970
which is very useful and it's used a lot

42
00:01:53,970 --> 00:01:56,040
as a Systems Administrator.

43
00:01:56,040 --> 00:01:56,873
At this point,

44
00:01:56,873 --> 00:01:59,253
we're going to test out the man command on grep.

45
00:02:01,860 --> 00:02:04,230
Grep searches the named input files,

46
00:02:04,230 --> 00:02:06,360
or standard input if no files are named,

47
00:02:06,360 --> 00:02:09,840
or if a single hyphen minus is given as a file name,

48
00:02:09,840 --> 00:02:12,690
for lines containing a match to the given pattern.

49
00:02:12,690 --> 00:02:15,450
By default, grep prints the matching lines.

50
00:02:15,450 --> 00:02:17,820
So we see grep uses a pattern,

51
00:02:17,820 --> 00:02:20,280
and we can get all this information from the description.

52
00:02:20,280 --> 00:02:21,690
We'll look at the synopsis.

53
00:02:21,690 --> 00:02:26,070
You see grep, options, the pattern, and a file.

54
00:02:26,070 --> 00:02:27,300
So as you go through,

55
00:02:27,300 --> 00:02:29,610
you'll see all the available options

56
00:02:29,610 --> 00:02:31,440
and then the pattern is what you're looking for,

57
00:02:31,440 --> 00:02:32,970
typically a string.

58
00:02:32,970 --> 00:02:34,890
If you want to look for a specific file

59
00:02:34,890 --> 00:02:36,420
or look through a specific file,

60
00:02:36,420 --> 00:02:38,720
that's where you will insert that value there.

61
00:02:39,570 --> 00:02:42,000
Okay, we're just going to scroll down.

62
00:02:42,000 --> 00:02:44,073
See all the available options here?

63
00:02:48,660 --> 00:02:50,580
Now, it's very similar to the less command

64
00:02:50,580 --> 00:02:52,443
where you use space,

65
00:02:54,060 --> 00:02:55,383
page up, page down.

66
00:02:57,750 --> 00:02:59,823
As we see, grep is pretty extensive.

67
00:03:00,690 --> 00:03:02,160
It's a lot of different information,

68
00:03:02,160 --> 00:03:03,000
a lot of different commands

69
00:03:03,000 --> 00:03:04,560
that we can use for this thing, all right?

70
00:03:04,560 --> 00:03:06,420
Now, when we're using the manual,

71
00:03:06,420 --> 00:03:10,140
we can use forward slash case.

72
00:03:10,140 --> 00:03:12,540
It's going to be example, we're going to search the manual

73
00:03:12,540 --> 00:03:15,303
for the instance of the word case.

74
00:03:16,770 --> 00:03:19,140
All right, so we see every instance

75
00:03:19,140 --> 00:03:20,673
of case used in the manual.

76
00:03:22,620 --> 00:03:24,360
The dash i will ignore

77
00:03:24,360 --> 00:03:27,660
the case of the word that we're using.

78
00:03:27,660 --> 00:03:28,740
So that means it doesn't matter

79
00:03:28,740 --> 00:03:30,360
if it's uppercase or lowercase,

80
00:03:30,360 --> 00:03:34,320
it will return the line of the file based off the word,

81
00:03:34,320 --> 00:03:36,063
and it's case insensitive.

82
00:03:36,900 --> 00:03:38,280
And we press the N

83
00:03:38,280 --> 00:03:42,393
to go to the next indication of the word case in the file.

84
00:03:45,810 --> 00:03:46,950
Looks like there's no more.

85
00:03:46,950 --> 00:03:47,890
Now we can do

86
00:03:49,800 --> 00:03:52,623
Shift N to go back if we need to.

87
00:03:54,420 --> 00:03:56,100
Little gee whiz there.

88
00:03:56,100 --> 00:03:57,443
Now we have a little information about grep.

89
00:03:57,443 --> 00:03:59,790
This is a good example.

90
00:03:59,790 --> 00:04:00,693
Let's test it out.

91
00:04:02,220 --> 00:04:04,050
Use the I option.

92
00:04:04,050 --> 00:04:05,100
Remember that means sed.

93
00:04:05,100 --> 00:04:06,900
I'm just going to search for

94
00:04:06,900 --> 00:04:09,210
any word,

95
00:04:09,210 --> 00:04:10,710
ignoring the case.

96
00:04:10,710 --> 00:04:11,823
I'm going to use my file.

97
00:04:12,810 --> 00:04:15,300
It's going to return any line in that text

98
00:04:15,300 --> 00:04:16,850
that contains those characters.

99
00:04:19,110 --> 00:04:21,060
And we see that ran through successfully.

100
00:04:21,060 --> 00:04:23,460
Now let's look up some more information about grep.

101
00:04:23,460 --> 00:04:24,877
So we're going to go to usr,

102
00:04:28,680 --> 00:04:30,451
share, slash,

103
00:04:30,451 --> 00:04:32,850
doc directory.

104
00:04:32,850 --> 00:04:34,560
And this directory contains a lot more information

105
00:04:34,560 --> 00:04:37,290
about different commands we would like to look into.

106
00:04:37,290 --> 00:04:38,583
So as we see,

107
00:04:39,600 --> 00:04:43,290
this is a catalog of all the documentation relative

108
00:04:43,290 --> 00:04:45,360
to different commands and their versions.

109
00:04:45,360 --> 00:04:47,100
So we're going to search grep here

110
00:04:47,100 --> 00:04:49,323
and remember to use our trusty tab command.

111
00:04:50,460 --> 00:04:51,293
Let's see

112
00:04:52,560 --> 00:04:53,793
CD, sorry,

113
00:04:54,630 --> 00:04:56,580
grep with a tab here.

114
00:04:56,580 --> 00:04:59,910
So now we'll go to this directory, list all the contents.

115
00:04:59,910 --> 00:05:03,180
And now we see we have all the documentation for grep

116
00:05:03,180 --> 00:05:04,530
within this directory here.

117
00:05:07,620 --> 00:05:10,350
Now let's get the news,

118
00:05:10,350 --> 00:05:11,850
see what it has to say for us.

119
00:05:15,930 --> 00:05:17,910
All right. So we're able to look at

120
00:05:17,910 --> 00:05:20,610
documentation information about grep.

121
00:05:20,610 --> 00:05:23,280
This is a lot of good information that you can use directly

122
00:05:23,280 --> 00:05:25,188
on the command line without having to search

123
00:05:25,188 --> 00:05:27,513
any third party files or anything like that.

124
00:05:30,060 --> 00:05:32,223
Bug fixes, things of that nature.

125
00:05:34,650 --> 00:05:36,720
All right, let's get out of here.

126
00:05:36,720 --> 00:05:39,900
To conclude, we just used the manual function

127
00:05:39,900 --> 00:05:41,550
to help us look up some information

128
00:05:41,550 --> 00:05:42,720
about different commands.

129
00:05:42,720 --> 00:05:44,610
For this example we used grep,

130
00:05:44,610 --> 00:05:46,470
which is something that you're going to use very often

131
00:05:46,470 --> 00:05:49,350
as being a Systems Administrator, especially for Linux.

132
00:05:49,350 --> 00:05:50,790
So I hope this helps

133
00:05:50,790 --> 00:05:52,840
and I'll see you again in the next video.

