Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
print-utf8(1)		     General Commands Manual		   print-utf8(1)

NAME
     print-utf8 -- prints UTF-8 strings

SYNOPSIS
     print-utf8 [-n | --newline] [-i indentation | --indent indentation]
		[string]
     print-utf8 [-n | --newline] [-x console_width | --columns console_width]
		[-c | --center] [string]
     print-utf8 [-n | --newline] [-x console_width | --columns console_width]
		[-I indentation left right | --multiline-indent indent-
		ation left right]
     print-utf8 [-n | --newline] [-x console_width | --columns console_width]
		[-C left right | --multiline-center left right]
     print-utf8 [-n | --newline] [-x console_width | --columns console_width]
		[-s left separator right | --separator left separator right]
     print-utf8 [-b | --size] [string]
     print-utf8 [-l | --length] [string]
     print-utf8 [-w | --width] [string]
     print-utf8 [-a | --size-length-width] [string]
     print-utf8 [-t | --terminal-info]
     print-utf8 [-h | --help]
     print-utf8 [-v | --version]

DESCRIPTION
     print-utf8  is  a simple program to print UTF-8 strings in the console with
     options for indentation, centering, separator as well as  size/length/width
     information.  If /dev/tty is not available to obtain the terminal width and
     height, the default of 80x24 is assumed.

ARGUMENTS
     The following options are available:

     -n | --newline
	     Add a newline to the output. Default: off.

     -i indentation | --indent indentation
	     Indent the string by the given number of characters (columns in the
	     console).	A  negative number leads to left-justified text, a posi-
	     tive number leads to right-justified text.

     -c | --center
	     Center the string, using indentation based on the	current  console
	     width.

     -I indentation left right | --multiline-indent indentation left right
	     Reads multiple lines from stdin, indent each line by given indenta-
	     tion, add a prefix left and a suffix right.

     -C left right | --multiline-center left right
	     Reads  multiple lines from stdin, pads them to the same length, and
	     prints them centered with given borders on left and right side.

     -s left separator right | --separator left separator right
	     Generates a separator, consisting of a left part, a variable number
	     of separator string occurrences, as well as a right part.	The sep-
	     arator string must have a width >= 1 to fill the line. Otherwise, a
	     space (" ") is used instead.

     -x console_width | --columns console_width
	     Set number of columns (console width) for "center", "multiline-cen-
	     ter", and "separator" functions (see above).  For	console_width=0,
	     the  current  console  width (or from 80, if unknown) is used.  For
	     console_width<0, the current console width (or from 80, if unknown)
	     plus console_width (subtraction, since it is  negative!)  is  used.
	     Default: 0, i.e. current console width.

     -b | --size
	     Print  the  size  (bytes)	of  the  string without ANSI control se-
	     quences.

     -l | --length
	     Print the length (in UTF-8 characters) of the string  without  ANSI
	     control sequences.

     -w | --width
	     Print the width (columns in the console) of the string without ANSI
	     control sequences.

     -a | --size-length-width
	     Print the size, length and width of the string without ANSI control
	     sequences.

     -t | --terminal-info
	     Print  current  width  and  height  of  the  console.  Note that if
	     /dev/tty is not available, the default of 80x24 is returned!

     -h | --help
	     Prints the program's command-line parameters and exits.

     -v | --version
	     Prints the program version and exits.

EXIT STATUS
     The print-utf8 tool exits with 0 on success, and >0 in case of an error.

EXAMPLES
     print-utf8 --newline --center "This line is centered in console width!"

     print-utf8 --newline --columns 80 --center "This line  is	centered  in  80
	     columns!"

     print-utf8    --newline	--center   '\x1b[38;2;241;71;29mThis   line   is
	     centered!\x1b[0m'

     figlet "$(date +"%y-%m-%d")" | print-utf8 --newline  --multiline-indent  64
	     "< " " >"

     figlet  "$(date +"%y-%m-%d")" | print-utf8 --newline --multiline-indent -64
	     "< " " >"

     figlet "This is a test!" | print-utf8  --newline  --multiline-center  "<dh"
	     "dh>"

     figlet "This is another test!" | print-utf8 -x -8 -n -C "<dh" "dh>"

     figlet "Right" | print-utf8 -n -I +72 "dh" "dh"

     figlet "Left" | print-utf8 -n -I -72 "dh" "dh"

     date +"%d. %m. %Y %H:%M:%S" | figlet -w 128 | print-utf8 -n -C "[dh" "dh]"

     print-utf8 -n -c "dhdhdh This line is centered in console width! dhdhdh"

     print-utf8 -n -x 80 -c "dhdhdh This line is centered in 80 columns! dhdhdh"

     print-utf8 --indent -32 "Left: " && echo "1234"

     print-utf8 --indent +32 "Right: " && echo "1234"

     print-utf8 --newline --separator "<*" "=" "*>"

     print-utf8 --columns 80 --newline --separator "<*" "=" "*>"

     print-utf8 -n -s "<dh>>dh" "=" "dhdh>>>"

     print-utf8 --width "Test"

     print-utf8 --width "Test AxA<paragraph>A1/4"

     print-utf8 -b "dh Test dh"

     print-utf8 -l "dh Test dh"

     print-utf8 -w "dh Test dh"

     print-utf8 -a "dh Test dh"

     print-utf8 --terminal-info

     print-utf8 -n -s "\e[1;34ma" "a" "a\e[0m" ;
	     date +"%d. %m. %Y %H:%M:%S" | figlet -w 128 | \
	     print-utf8 -n -C "\e[1;34madh\e[1;31m" "\e[1;34mdha\e[0m" ;
	     print-utf8 -n -s "\e[1;34ma" "a" "a\e[0m"

     print-utf8 -n -s "\e[1;31;5ma" "a" "a\e[0m" ;
	     echo   "ERROR    1234"   |   figlet  -w  128  |  print-utf8  -n  -C
	     "\e[1;31;5ma\e[25m" "\e[5ma\e[0m" ;
	     print-utf8 -n -s "\e[1;31;5ma" "a" "a\e[0m"

     print-utf8 -n -s "\e[1;31;40;5ma" "a" "a\e[0m" ;
	     echo -e "Software	Failure.    Press  left  mouse	button	to  con-
	     tinue.\nGuru Meditation #00000004.48454C50" | \
	     print-utf8 -n -C "\e[1;31;40;5ma\e[25m" "\e[5ma\e[0m" ;
	     print-utf8 -n -s "\e[1;31;40;5ma" "a" "a\e[0m"

     print-utf8 -n -x 44 -s "\e[1;32ma" "a" "a\e[0m" ;
	     ls  /  |  print-utf8  -n  --multiline-indent  -42 "\e[1;32ma\e[34m"
	     "\e[1;32ma\e[0m" ;
	     print-utf8 -n -x 44 -s "\e[1;32ma" "a" "a\e[0m"

     print-utf8 -h

     print-utf8 --help

     print-utf8 --version

     print-utf8 -v

SEE ALSO
     System-Info(1), text-block(1)

NOTES
     This program is part of System-Tools. The latest  version	of  System-Tools
     can be found on the System-Tools Homepage at System-Tools Homepage.

AUTHORS
     Thomas Dreibholz, Homepage

print-utf8			   May 9, 2026			   print-utf8(1)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=print-utf8&sektion=1&manpath=FreeBSD+Ports+15.1.quarterly>

home | help