In this tutorial, we will cover the installation and usage of LF file manager on Linux. LF which is an abbreviation of (List files) is console file manager written in Go.
LF provides minimalistic and nice curses interface with a view on the directory hierarchy on terminal. It gives you a quick way to switch directories and browse the file system.
Features of LF File Manager
LF comes with the following features
- Since it is written in Go, it shipped as a single binary without any runtime dependencies (except for terminfo database)
- Uses Server/client architecture to allow sharing of files selection between multiple instances
- LF is cross-platform - Runs on Linux, OSX, BSDs, Windows (partial)
- Has fast startup and low memory footprint (due to native code and static binaries)
- Easy to configure and tweak using shell commands
- It has customizable keybindings ( uses vi and readline defaults)
- Provides Preview filtering (for source-highlighting, archives, pdfs/images as text etc.)
LF leaves some other features to be handled by OS third-party tools, this include:
- Tabs or windows (handled by window manager or terminal multiplexer)
- Image previews (cool but no standard available)
- Built-in pager/editor (handled by your pager/editor of choice)
Installing LF on Linux / Unix (Standard way)
Now that we've covered the basics of LF tool, let us proceed to the installation. A standard way to install LF is by downloading the binary package and placing it in your $PATH directory.
Go to LF Releases page on github, download version relevant to your Operating system. For me I'll pull Linux 64-bit version:
$ wget https://github.com/gokcehan/lf/releases/download/r6/lf-linux-amd64.tar.gz \ -O lf-linux-amd64.tar.gz
Available versions are for Linux, Windows, OpenBSD, NetBSD, both 32-bit and 64-bit CPU Architectures.
After downloading the package, extract it using tar:
$ tar xvf lf-linux-amd64.tar.gz
lf-linux-amd64.tar.gz with your valid file name. A b inary file called ` will be extracted to your current working directory:
Make the file executable:
$ chmod +x lf
Copy the file to /usr/local/bin directory:
$ sudo mv lf /usr/local/bin $ which lf /usr/local/bin/lf $ lf --help Usage of lf: -cpuprofile string path to the file to write the CPU profile -doc show documentation -last-dir-path string path to the file to write the last dir on exit (to use for cd) -memprofile string path to the file to write the memory profile -remote string send remote command to server -selection-path string path to the file to write selected files on open (to use as open file dialog) -server start server (automatic) -version show version
Installing LF From Packages
Few packages have been created for Arch Linux & Void Linux. This can easily be installed by using the system package manager.
Installing LF on Arch Linux from AUR
On Arch Linux, install
lf package using AUR helper of your choice. Refer to our guide How to Install Packages on Arch Linux
On my Arch, I'm using.
$ yay -S lf
It will ask you to download the git version or more stable one. I'll choose
You can also use
yaourt for this:
$ yaourt -S lf
Installing LF on Void Linux from Package Manager
For Void Linux users, the Package is available in the repository.
$ sudo xbps-install lf
Using LF File Manager
After the installation
lf command should start the application in the current directory. You can run:
$ lf -help
to see command line options.
To read through the documentation use:
$ lf -doc
If you run
lf on the terminal, you should get a window like below
You can easily navigate using arrow keys.
As an example, by using<right arrow> or l key, I can play a Video file from
The following commands are provided by
lf with default keybindings:
up (default 'k' and '<up>') half-up (default '<c-u>') page-up (default '<c-b>' and '<pgup>') down (default 'j' and '<down>') half-down (default '<c-d>') page-down (default '<c-f>' and '<pgdn>') updir (default 'h' and '<left>') open (default 'l' and '<right>') quit (default 'q') top (default 'gg' and '<home>') bottom (default 'G' and '<end>') toggle (default '<space>') invert (default 'v') unmark (default 'u') copy (default 'y') cut (default 'd') paste (default 'p') clear (default 'c') redraw (default '<c-l>') reload (default '<c-r>') read (default ':') shell (default ' Note that many things still change frequently in lf which may require users to modify their configurations. For further customizations, read the Official lf Administration guide. Read Also:
- How to Install tmux and Manage Multiple Linux Terminals
- How to Install i3 Window Manager in Linux
- AMP - Fully Featured Text Editor for Linux Terminal
- Install Tilix Terminal Emulator in Ubuntu/Fedora/Arch Linux
Note that many things still change frequently in lf which may require users to modify their configurations. For further customizations, read the Official lf Administration guide.