Yes, I know
The Fold and Fmt Commands

When you use a word processor, formatting text so the lines will fit in the available space on the target device should not be an issue. But when working at the terminal, things are not that easy. Of course, you can always break lines by hand using your favorite text editor, but this is rarely desirable, and it’s even out of the question for automated processing. Hopefully, the POSIX fold utility and the GNU/BSD fmt command can help you to reflow a text so lines will not exceed a given length.

 Get the support materialCheck your mailbox for the link!  View on YouTube 

Share 
The Fold and Fmt Commands

In practice, you will rarely use the fold and fmt commands alone. They often are the final stage of some pipeline involving data extraction or text transformation commands like grep, awk or sed. If you do not already know those commands, I suggest you take a look at the following videos for an introduction:

Some knowledge of the awk and sed commands will especially be interesting here since they are required to solve to video’s challenge. So review the syntax of those commands if needed, then, once you will have answered the challenge, don’t forget to post your solution in the comment section!

How can I take the most of this video?

I encourage you to download the files used on the video so you will be able to try the same commands as me on your own system.

The link above will allow you to download a gzipped tar archive of the files used in the video. To extract the content of that archive on your system, you can use the command:

    tar xzf Yes_I_Know_IT-EP24.tar.gz
    cd EP24

If you don’t have the time to watch the video entirely, here are few links to jump directly to the section that interests you the most:

Share to Help me reach my next YouTube milestone!

It’s a lot of work to maintain this channel, and the only thing I can take joy in from what I do is seeing more subscribers and the channel growing. That’s why I’m asking you to recommend and share the following links on your favorite social media and websites. Thanks!