lf
File manager with terminal-like navigation
SYNOPSIS
lf [path] [options]
PARAMETERS
path
The directory to start lf in. If omitted, lf starts in the current working directory.
-config path
Specifies an alternative path to the configuration file, overriding the default.
-doc
Displays lf's built-in documentation and exits.
-last-dir-path path
Specifies a file to store the path of the last visited directory, used for shell integration.
-cpuprofile path
Writes CPU profile data to the specified file (primarily for debugging and performance analysis).
-memprofile path
Writes memory profile data to the specified file (primarily for debugging and memory usage analysis).
-version
Displays the version information of lf and exits.
DESCRIPTION
lf is a highly efficient and customizable terminal file manager written in Go. Inspired by popular file managers like ranger and nnn, lf aims to provide a minimalistic yet powerful interface for navigating and managing files in the command line. It features a simple two-pane layout by default, showing directories on the left and their contents on the right, but it can be configured to display different views. lf is known for its speed, low resource usage, and extensive customization options through configuration files, allowing users to define keybindings, color schemes, and command-line shell integration. It offers basic file operations like copying, moving, deleting, and renaming, and also supports external commands and scripts for more advanced actions. Its design emphasizes keyboard-driven navigation, making it a favorite for power users who prefer staying in the terminal.
CAVEATS
Primarily keyboard-driven, which might require a learning curve for new users.
Configuration is done via a Go-like scripting language in lfrc, which can be different from traditional shell scripting.
Relies heavily on external tools for advanced file previews (e.g., sxiv for images, bat for code highlighting).
Does not have a built-in 'trash' or 'undo' functionality for file operations.
CONFIGURATION
lf is highly customizable via its configuration file, typically located at $XDG_CONFIG_HOME/lf/lfrc or ~/.config/lf/lfrc. This file allows users to define keybindings, set options, configure color schemes, and execute custom commands or scripts upon certain events. The configuration language is a simple Go-like script, enabling powerful automation and integration with other command-line tools.
SHELL INTEGRATION
lf provides helper scripts to integrate with various shells (bash, zsh, fish). These scripts typically allow lf to change the shell's current working directory to the directory it was exited from, which is a common and highly desired feature for terminal file managers. This significantly enhances workflow efficiency by seamlessly bridging the file manager's navigation with the shell's prompt.
HISTORY
lf was created by Arshia Mirabdullah (gokcehan on GitHub) and first released in 2018. It quickly gained popularity as a lightweight and fast alternative to `ranger`, written in Go. Its development has focused on performance, simplicity, and extensive customization through its configuration file and shell integration, becoming an active open-source project favored by terminal enthusiasts.