lf — terminal file manager
In this post, we’ll look at the lf (List Files) command, which is often mentioned alongside nnn as one of the two mainstays of terminal file managers.
If the nnn discussed earlier feels like Dolphin ported to a TUI, then lf is closer to an extremely lightweight version of the file explorer pane in Visual Studio Code (VS Code), a terminal text editor familiar to Linux users, or Ranger.
It is written in Go, so it is fast, and it is generally considered to have a slightly more intuitive screen layout than nnn.
🖥️ The Actual Output Layout of the lf Command
When you run lf, its most distinctive visual characteristic is that the screen is split into three columns. It shows more information at a glance than nnn.
Downloads/ ▶ 📂 Projects/ ▶ 📂 src/ ← [3-column layout]
Documents/ 📂 Document/ 📜 main.go
Photos/ 📄 memo.txt 🖼️ logo.png
🖼️ screenshot.png
---------------------------------------------------------------------------------
~/.config/lf/lfrc 100% 1/4 [15.2K]
- Left column: Lists the parent (previous) folder.
- Middle column: Shows the files in the folder you are currently in. (> the cursor is located here)
- Right column: Shows a real-time preview of the folder the cursor is pointing to, or a preview of the file contents.
🚀 How to Install
- Ubuntu / Debian:
sudo apt install lf - Arch Linux:
sudo pacman -S lf - macOS (Homebrew):
brew install lf
⌨️ How Do You Actually Use It? (Core Usage)
Because it uses Vim editor keybindings (hjkl) as its core navigation, it feels very familiar to developers.
Basic Navigation
- k / j (or ↑ / ↓): Move up and down through files
- l (or → / Enter): Enter a folder / open a file
- h (or ←): Exit to the parent folder
File Management Tasks
- y (Yank): Copy
- d (Cut): Cut (prepare to move)
- p (Paste): Paste (place copied or cut files)
- clear: Cancel the copy/cut selection
- delete: Delete files
Search and Filter
- /: Live search (as you type, the cursor jumps to files containing those characters)
⚔️ nnn vs lf at a Glance (from a Server Administrator’s Perspective)
Both commands are excellent for server management, but each has slightly different strengths.
| Comparison item | nnn | lf |
|---|---|---|
| Development language | C (extreme minimalism) | Go (modern and clean) |
| Screen style | Simple single-column output (optimized for showing file sizes) | Three-column layout (parent–current–preview) |
| Preview | Supported in a separate window only after enabling a plugin | Provides content preview in the right column by default |
| Configuration convenience | Configured mainly through environment variables and plugins | Intuitive customization through the lfrc configuration file |
nnn is great for using a wide screen and seeing the file list and sizes clearly, while lf is very convenient for editing server configuration files because you can immediately check code or text content in the right column without even opening the file.
Between nnn and lf, which screen style—simple single-column vs. three-column with preview—seems to fit your server management style better?
Actual Running Screen
This is a screenshot of lf running directly on this PC. From left to right, the parent folder, current folder, and preview of the selected item are displayed in three columns, with a status bar at the bottom.
A real production server
The owner/group information in the status bar at the bottom of the screen has been blacked out.
Source (HTML): https://games.aidebatehub.com/programs/linux/filesystem/lf.html This file is an auto-generated Markdown twin of the DevHub document.
AI Knowledge Hub
Visitor Comments