Lf
d- Cut (for moving files)y- Copy (yank)p- Paste (move/copy files from buffer)c- Clear cut/copy bufferspace- Toggle selection of current filev- Invert selection (select all unselected)u- Unselect all files
zh- Toggle hidden fileszr- Toggle reverse sortzn/zs/zt- Toggle info display (none/size/time)
r- Rename current file- No default delete mapping (for safety - you need to define your own)
lor→- Open file/enter directoryo- Open with system default (custom mapping)
- Use
spaceto select one or more files (or leave on current file for single delete) :thendeleteto remove selected/current files (lf will prompt for confirmation)
:- Enter command mode (lf built-in commands)
| Key | Mode | Terminal | Blocks lf? | Use for |
|---|---|---|---|---|
$ |
shell | Takes over terminal | Yes, until command exits | Interactive commands, editors, anything with UI |
! |
shell-wait | Takes over terminal, then shows “press any key” | Yes | Commands whose output you need to read before returning |
% |
shell-pipe | Inline at bottom of lf | Yes | Quick one-liners where you want to stay in lf (du -sh $fx) |
& |
shell-async | None (detached) | No | Background tasks, opening GUI apps |
All four modes export $f, $fs, and $fx (see below).
When you run a shell command ($, %, !, or &), lf exports these variables:
| Variable | Description |
|---|---|
$f |
Current file (under cursor), full path |
$fs |
All selected files, newline-separated |
$fx |
Selected files if any, otherwise falls back to $f |
$fx is the most useful — it always does the right thing whether or not you have a selection.
Quick workflow: select files with space, press $ (or %/!/&), use $fx in your command:
# show sizes of selected files
du -sh $fx
# iterate over selections (handles spaces in filenames)
IFS='
'
for f in $fx; do
echo "Processing: $f"
done
/- Search forward?- Search backwardn/N- Next/previous search resultf/F- Find character forward/backward;/,- Next/previous find result
q- QuitQ- Quit and cdCtrl+l- Redraw screenCtrl+r- Reload current directory