🖥️fold

➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the fold command with important options and switches using examples.

▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁

#                ███████╗ ██████╗ ██╗     ██████╗ 
#                ██╔════╝██╔═══██╗██║     ██╔══██╗
#                █████╗  ██║   ██║██║     ██║  ██║
#                ██╔══╝  ██║   ██║██║     ██║  ██║
#                ██║     ╚██████╔╝███████╗██████╔╝
#                ╚═╝      ╚═════╝ ╚══════╝╚═════╝ 
                

                                                 
Fold

# The fold command wraps each input line to fit in specified width.

fold -w 10
Hi my name is himanshu Arora

Hi my name
is himans
hu Arora

fold -w 72 -s draft.txt > newdraft.txt 
# Wrap the lines of draft.txt at 72 characters wide, doing so at spaces, not middle of word (-s).

# draw honeycomb
# Fill the entire terminal screen. Is COLUMNS or LINES are undefined run "resize"
yes "\\__/ " | tr "\n" " " | fold -$((($COLUMNS-3)/6*6+3)) | head -$LINES

# Generate a random 32 characters password
tr -dc 'a-zA-Z0-9~!@#$%^&*_()+}{?></";.,[]=-' < /dev/urandom | fold -w 32 | head -n 1

#==============================##==============================#
# CMD fold						       #
#==============================##==============================#
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

  █║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌

              ██╗ ██╗ ██████╗  ██████╗ ██╗  ██╗███████╗██████╗
             ████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
             ╚██╔═██╔╝██║  ██║██║   ██║ ╚███╔╝ █████╗  ██║  ██║
             ████████╗██║  ██║██║   ██║ ██╔██╗ ██╔══╝  ██║  ██║
             ╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
              ╚═╝ ╚═╝ ╚═════╝  ╚═════╝ ╚═╝  ╚═╝╚══════╝╚═════╝

               █║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌

░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░