hr
Draw horizontal rule in the terminal
TLDR
Print a horizontal rule
Print a horizontal rule with a custom string
Print a multiline horizontal rule
SYNOPSIS
hr [options]
Note: This synopsis represents a common usage pattern for various non-standard hr implementations, particularly those focused on drawing horizontal rules. Actual options may vary.
PARAMETERS
--width, -w
Specifies the desired width of the horizontal rule. If not specified, it often defaults to the terminal's width.
--line, -l
Defines the character(s) used to draw the horizontal line (e.g., '-', '=', '*'). Defaults to a dash character.
--color, -c
Sets the color of the horizontal rule, often using ANSI escape codes or predefined names (e.g., 'red', 'blue').
--align, -a
Controls the alignment of the rule within the terminal space (e.g., 'left', 'center', 'right').
--padding, -p
Adds empty space (padding) around the horizontal rule, often specified in characters.
--version
Displays the version information of the hr utility being used.
--help
Shows the help message and available options for the hr utility.
DESCRIPTION
The command hr is not a standard utility found in most Linux distributions by default. It commonly refers to a user-defined alias or function, or a third-party command-line tool, primarily used for generating and displaying a horizontal rule (a line of repeating characters) in the terminal. These rules are often employed for visual separation in scripts, logs, or command-line output to improve readability. While its core functionality is simple, specific implementations of hr can offer various customization options, such as specifying the width of the line, the character used to draw it, its color, and alignment. Users typically install such hr utilities separately or define them in their shell configuration files (e.g., .bashrc, .zshrc) to quickly produce decorative or organizational separators. Its non-standard nature means its exact behavior and available options can vary significantly depending on how it's implemented or which specific third-party package is installed.
CAVEATS
The hr command is not a standard part of most Linux distributions. Its availability, functionality, and options depend entirely on whether a user has defined it as a shell alias/function or installed a specific third-party utility. Users attempting to use hr without prior installation or definition will likely encounter a "command not found" error. Therefore, its behavior is not universal or predictable across different systems and can vary significantly.
COMMON IMPLEMENTATIONS AND INSTALLATION
The most prevalent hr implementations are custom shell aliases/functions (e.g., alias hr='printf %s $(eval printf '%.0s-' {1..$(tput cols)})' for Bash/Zsh) or dedicated third-party packages. For example, Node.js users might install a popular hr utility globally via npm (npm install -g hr), while Python users might find similar utilities through pip. The exact installation steps and available features vary depending on the chosen implementation.
HISTORY
The concept of a hr command, for "horizontal rule," largely emerged from the widespread need for simple visual separators in terminal output. Initially, users would achieve this by manually typing repeating characters or using echo with a hardcoded string of dashes. Over time, shell aliases and functions became popular ways to automate this, providing a quick hr command. Various third-party utilities, often written in scripting languages like Node.js or Python, were developed to provide more robust and configurable horizontal rule generation, offering options for width, character, and color, and distributing them via package managers. This evolution reflects a common pattern in the Linux ecosystem where user needs for simple, repetitive tasks lead to custom scripts and eventually dedicated utilities.