Using cut
There are tools in IT that get elevated to greatness by the simple fact that they are great tools. The next three tools that we are going to use are tools that fit the description of some of the greatest CLI tools ever invented. For us, cut
is the second greatest CLI command of all time; if you want to find out which command takes the coveted #1 spot, stay tuned for the next recipes.
cut
is a tool that can make our lives a lot easier if we're working with preformatted input. For example, it will easily work with CSV, as that's a formatted type of content that can be easily digested by cut
. Let's learn about cut
by doing some examples next.
Getting ready
We just need one Ubuntu machine for this recipe, so let's keep using cli1
. The cut
command is a standard part of any Linux distribution and that's how it should be, as it's more important than other commands, such as ls
, mkdir
, and ps
.
How to do itβ¦
Let's first create...