 Okay, today we're going to be looking at the cut command which is a basic command we use all the time I use all the time real quick. I've created a file here called file dot txt. We'll go in and have a look at it It contains seven lines One's an empty line. We've got two lines that I consider headers Giving these little sections here. This one's saying this is a file. This one's saying new section then we have This I just create this for this tutorial the questions or comments I guess this is a test and then the answer is yes This is not a test. The answer is no and dividing up the the statements and the response by a pipe symbol So what I could do if I wanted to let's say just get all the questions I could say um Cut I can say cat File dot txt. So we're catting out the file which displays the file I can now pipe that into cut with a delimiter of pipe and field one So only show things on the left side of this pipe I'll hit enter there and we get only the things on the left side of the pipe on the lines with the pipe Symbols so you know so we don't have the no or the yes in these sections here but we're also getting the lines that we don't care about the the empty line and the Second the titles of the sections so what we could do here is before we cut it We could always grep for lines Well, let me remove the cut so you can see this we're grepping only the lines with the pipe symbol and then we can say cut with a delimiter of pipe and Field one so there we go. We get the output we want that's kind of a long command We're actually running three separate Processes here or cat and then grep and then cut we're all could really be done. We just cut That's not the only way of doing this there are other techniques But let's just see how we could do it with the cut command. We're gonna say cut dash d backslash the pipe symbol so the pipe symbol is our delimiter we're gonna say f1 and Then we're gonna give it the file name so there's no need to cat That's a bad habit of mine. Obviously. I've noticed for a while. You probably all know this I have a tendency to cat everything into both cut and grep. We're both don't need to be cat it in so there you go We got Everything on the left side of the pipe on the lines at a pipe But we're still getting the lines that we don't care about our titles in the empty line So what we could do is adding to this cut command we can add in a Dash s the dash s says only show the lines containing the delimiter So we'll ignore all lines that don't have a pipe symbol so this point I can hit enter and you can see we get the output that we're looking for Which is the same output we got up here, but doing it all with one command rather than three commands Piped into each other. So I hope you found this tutorial useful Dash s tells cut to only display lines containing the delimiter that you've stated here Which could be any single character. So I thank you for watching. Please visit filmsbychrist.com. That's Chris of the K I hope that you have a great day, and I hope you enjoy the tutorial