 Welcome today. We're gonna be looking at shuffling files not just the files themselves But we're gonna be looking at shuffling the contents of files and the file names So real quick where I'm gonna be using the chef command, which may not be installed by your on your system by default Will probably be in your repositories. I know it is for Debian based systems for some reason I feel like at some point I heard that this Command is not available in certain distributions like it might be Debian specific and Debian derivatives I'm not sure just bringing that up, but if you're running Ubuntu Linux Mint a lot of Systems are based on Debian that should be in there and possibly other distributions as well But it's a very useful command So I've got a couple files here file one file two file three file four file five and if I count out file one You can see it has nine lines line one line two so forth and so on I can just pipe this once I have the shuffle command and solve a chef command and it will shuffle them and each time I run this It will shuffle them thing is you don't have to cat and pipe it chef can take the file input itself So instead of doing this we're going to do this and it does the same thing without the extra process of Cat and piping it in great. So we've shuffled up a file. What if I wanted to grab just a certain number of random files? Or random lines from that file what I can do is I can do dash n and give it a number So I'll say for so now it's going to shuffle the file and output for the lines So now we get these lines and each time I write so if you want to randomly grab different Lines from a file but limit how many they are you can do it all in one command like so So that's shuffling the lines of file and limiting the number of output. Let's do the same thing for file So again, I have five files in this directory. I could do list and pipe that list into shuff And now I have the list of files in a random order But if we give shuff the dash e command I can then say all files in this directory if I wanted to and it will shuffle them all of course Let me let me do this real quick. I'll just say touch file one dot text Touch file two dot text whoops and file three. So now I have File one file one dot text file two file two dot text if I want to I can also pass it You know this dot text and now it's only going to return ones that end in text or dot text And it's shuffling those up and just like before if we list out all these files Randomly we can give it the dash and and give it a number So we'll say three and I'll return only three of those files So that's shuffling files both the contents and the files themselves and it's not doing anything. It's just outputting the the list of Information in different orders so you can then pipe those into different commands Which we'll talk about more in a future video so the shelf command very useful I thank you for watching. Please visit films by chris calm That's Chris the K link in the description as well as a link to my patreon page thing out supporting I hope that you have a great day