LinuxCommandLibrary

freeze

Freeze XFS filesystem

TLDR

Generate an image of code based on a file

$ freeze [path/to/file]
copy

Specify the output path
$ freeze [path/to/file] [[-o|--output]] [path/to/output_image.png]
copy

Generate an image of terminal output
$ freeze [[-x|--execute]] [command]
copy

Interactively customize the output image
$ freeze [path/to/file] [[-i|--interactive]]
copy

Select a theme for syntax highlighting
$ freeze [path/to/file] [[-t|--theme]] [dracula]
copy

Use a base configuration template
$ freeze [path/to/file] [[-c|--config]] [base|full|user]
copy

Capture a specific range of line numbers
$ freeze [path/to/file] --lines [start],[end]
copy

Show line numbers
$ freeze [path/to/file] --show-line-numbers
copy

SYNOPSIS

freeze [delay]

PARAMETERS

[delay]
    Optional seconds to wait before freezing the display (defaults to 1). Specify 0 to freeze immediately.

DESCRIPTION

The freeze command, part of the moreutils package, temporarily halts the updating of the terminal display to prevent scrolling. This is particularly useful when running commands that produce lengthy output, ensuring important information remains visible at the top of the screen.

By default, freeze waits 1 second before activating the freeze. During this period, normal output continues. Once frozen, the screen stops scrolling regardless of further output, until any key is pressed, at which point normal behavior resumes.

This tool is handy for interactive sessions, debugging scripts with verbose output, or protecting prompts in shared terminals. It works on terminals supporting escape sequences like xterm, gnome-terminal, and similar, but may not function in all environments such as screen multiplexers or minimal consoles.

Installation is typically via package managers: apt install moreutils on Debian/Ubuntu or yum install moreutils on RHEL-based systems. It's lightweight and non-intrusive, making it a quick addition to shell scripts or aliases for output protection.

CAVEATS

Not a core Linux utility; requires moreutils package. Ineffective in some terminals or multiplexers like tmux/screen. Does not pause command execution, only display updates.

EXAMPLES

freeze # Waits 1s then freezes
freeze 0 # Freeze immediately
ls -la | freeze 3 # Freeze after 3s for directory listing

MECHANISM

Sends terminal escape sequence \033[?47h to switch to alternate screen, freezing scroll until keypress restores it.

HISTORY

Developed by Joey Hess as part of the moreutils collection, first released around 2006. Evolved with contributions for better terminal compatibility; widely available in major distros since 2010.

SEE ALSO

clear(1), reset(1), tput(1)

Copied to clipboard