 In my last video, we were counting the number of files in folders and subfolders and I Had lots of responses in the comments with slight variations Some people were showing because the command that I showed Gave you the total number of counts of files in a folder and its subfolders where some people are showing Examples where it broke down the individual subfolders and gave counts for those as well, but one of my viewers Valentin, this is his name right here He wanted to do it with Ock or actually Gawk So let's have a look at this is the original command or at least a close simulation of the original command if we run that I list all the Current folders and then it gives you a count on how many files are in that folder and subfolders putting the largest at the bottom So let's go ahead and have a look at his command Now I don't use Ock that much so this command looks a little confusing to me But if you read through it, it's it does make sense. It's if you actually get it It's not something I'd be able to type from memory, but let's go ahead and run it and see how it goes So there we go. He actually Counts how many Folders are in the current directory and then gives you their name and then gives you the count of Files and in that folder and subfolders subdirectories and also gives you a total count at the bottom Which is nice. He puts the largest Folders at the top so a little reverse from what I did, but it's nice But some of the formatting especially with long file names things get pushed over like that He was wondering if I could tell him how to break it down into columns So my first thought was to use the column command So take his Ock command and pipe that into column dash t like so and that kind of works So now we have the count the number over here the number of the directory the directory name and the The number of files inside that directory over here broken down at a nice columns But we already see some issues down here for example the total number and then there's a big long space here and then a big Long space here because it's using spaces in the line to decide where to put the columns And not only is it an issue down here at the bottom But if I was to go up you can see if there's any spaces in the file names Which you really should try to avoid but it does happen that those get Miscolumned as well. Well, he came back and he Suggested this morning Using column and then this command here and what this does is it's saying instead of using Spaces to decide where the columns are to use tabs And when I run that it doesn't really really work that much better for me because if you have long file names It's still pushing these numbers over but his command gave me an idea So if we come in here if I was to well remove that column command and go back into his command right here This percent four is the count for the files inside the directory I'm gonna put a pipe symbol before that so if I run that you can see now We are going to get all our information But right here we're putting a little pipe symbol and now that we do that I can go back and use his Suggestion of using column and but instead of using tabs I'm going to say use the pipe symbol and then use that to decide where the columns are so when I do that we have our Numbers over here we have our directory name and then we have a column over here with the count And it's kind of far because I do have some long names up here And it's going to go to the longest name So if we had shorter file names this column would be moved over, but it's all on a straight line So that's what I came up with love to see if you guys come up with anything better Maybe doing it still in the awk command without having to pipe into a new command Which I think was his maybe his original goal of using awk But I like that we've got this nicely form ad now and regardless of how long these file names are our Column over here with the count is all in a straight line and again So all I did Was add a pipe symbol because I figured there's not going to be any files with a pipe symbol in the name Hopefully and then we're using that as our delimiter if you will or our special character to decide where the columns go So I thank for thank you. I want to thank you all for your responses all the variations on this command And I hope that you all learn something and I hope that you have a great day