Now we can practice how to count file size using awk.
I will switch to directory VTC where I have lots of files by typing.
Ls l command.
We can see some information about files.
Each file has in the fifth column size in bytes and this is all we need to know.
Using this knowledge we can using a hog count all files disk size.
So let's read let's pass output from our S L command into awk program.
And in the main our section in-vivo for each record.
Do addition of fifth field which is this exercise
and after death in the end section we can print what is the final sum
and debt final sum is in bytes.
Now we can Handy's and we see some of this space of all files and directories and the links present
in the current directory.
Great if you want to show disk space in a byte we just divide the sum by 1000 24 and if you want to
know the sum in a megabyte we do the division by 1024.
So in this way we can easily count disk space for files.
So in next lecture we will use that in our script.