forked from gokcehan/lf
-
Notifications
You must be signed in to change notification settings - Fork 1
FAQ
CatsDeservePets edited this page Feb 11, 2026
·
3 revisions
Both flags turn lf into a file picker:
- Select the files you want.
- Confirm the selection by opening any file.
lf then exits and returns the selected paths:
-
-print-selectionprints them tostdout -
-selection-path <path>writes them to the given file
If you quit lf without confirming, the selection is discarded.
For security reasons, regular programs like lf can't change your shell's working directory.
A common workaround is printing or writing the last directory on exit and letting the shell cd into it. lf exposes the flags -print-last-dir and -last-dir-path for this purpose.
You can use one of the example lfcd wrapper shell scripts provided here:
https://github.com/gokcehan/lf/tree/master/etc