1
00:00:01,800 --> 00:00:06,460
Now we can practice how to count file size using awk.

2
00:00:06,510 --> 00:00:12,630
I will switch to directory VTC where I have lots of files by typing.

3
00:00:12,630 --> 00:00:14,020
Ls l command.

4
00:00:14,220 --> 00:00:18,270
We can see some information about files.

5
00:00:18,270 --> 00:00:27,830
Each file has in the fifth column size in bytes and this is all we need to know.

6
00:00:28,070 --> 00:00:34,800
Using this knowledge we can using a hog count all files disk size.

7
00:00:35,380 --> 00:00:48,040
So let's read let's pass output from our S L command into awk program.

8
00:00:55,570 --> 00:01:00,810
And in the main our section in-vivo for each record.

9
00:01:00,970 --> 00:01:05,820
Do addition of fifth field which is this exercise

10
00:01:13,820 --> 00:01:21,590
and after death in the end section we can print what is the final sum

11
00:01:30,620 --> 00:01:42,630
and debt final sum is in bytes.

12
00:01:42,700 --> 00:01:52,350
Now we can Handy's and we see some of this space of all files and directories and the links present

13
00:01:52,420 --> 00:01:53,710
in the current directory.

14
00:01:53,720 --> 00:02:06,270
Great if you want to show disk space in a byte we just divide the sum by 1000 24 and if you want to

15
00:02:06,270 --> 00:02:16,180
know the sum in a megabyte we do the division by 1024.

16
00:02:16,260 --> 00:02:20,960
So in this way we can easily count disk space for files.

17
00:02:21,150 --> 00:02:25,010
So in next lecture we will use that in our script.
