1. Iñigo Serna
  2. lfm


lfm /

Filename Size Date modified Message
34.3 KB
71.8 KB
152 B
10.4 KB
945 B
13.2 KB
1.9 KB
2.5 KB
1.6 KB
4.8 KB
1.6 KB
2.0 KB

lfm - Last File Manager

Author: Iñigo Serna, inigoserna AT gmail DOT com
Version: 2.1, December 21th. 2008
Home page:http://www.terra.es/personal7/inigoserna/lfm/

(C) 2001-8, Iñigo Serna

This software has been realised under the GPL License version 3 or later, read the COPYING file that comes with this package for more information.


Last update:Sat Dec 20 23:35:39 2008


Last File Manager is a simple but powerful file manager for the UNIX console. Based on curses, it's written in Python.

Some of the features you can find in lfm:

  • console-based file manager for UNIX platforms
  • 1-pane or 2-pane view
  • bookmarks
  • history
  • vfs for compressed files
  • dialogs with entry completion
  • fast access to a shell
  • direct integration of find/grep, df and other tools
  • tabs
  • color files by extension [Andrey Skvortsov]
  • fast file viewer with text and binary modes
  • ...and many others

From version 0.6 and up lfm package also contains pyview, a text / hex file viewer to be used with or without lfm. Read README.pyview for more info about it.

Some screenshots:





Type lfm --help or pyview --help for a complete list of options.

Program preferences are saved in ~/.lfmrc file. When the program starts the first time, it tries to discover the location of some apps in your system to configure lfm automatically, but it's not perfect, so you should take a look to the configuration (General Menu [F9] -> Edit Configuration [c]) and change it according to your preferences.


Lfm and Pyview are written in Python and require curses module. It needs Python v2.3 or higher, it won't work with older versions.

Since version 0.90, lfm needs ncurses >= v5.x to handle terminal resizing.

All modern UNIX flavours (Linux, *BSD, Solaris, etc) should run it without problems. If they appear please notify me.

Note that python curses module should be linked against ncursesw library (instead of ncurses) to get wide characters support. This is the usual case in later versions of Linux distributions, but maybe not the case in older Linux or other UNIX platforms. Thus, expect problems when using multibyte file names (f.e. UTF-8 or latin-1 encoded) if your curses module isn't compiled against ncursesw. Anyway, I hope this issue will disappear with new releases of those platforms, eventually.

Also, take a look at TODO file to see bugs and not-implemented-yet (tm) features.

Download & Installation

'lfm' is very easy to install, just keep next steps:

  1. Download sources

  2. Uncompress file

  3. Build:

    $ python setup.py build

  4. Install, as root:

    # python setup.py install

  5. Run it:

    $ lfm

To let 'lfm' to change to panel's current directory after quiting with q, Q or F10 keys, you must add next code to /etc/bashrc or to your ~/.bashrc:

    /usr/bin/lfm "$*"               # type here full path to lfm script
    cd "`cat $LFMPATHFILE`"
    rm -f $LFMPATHFILE

If you don't use bash or csh shell, above lines could differ.


If you upgrade from any older versions, please remove first ~/.lfmrc to regenerate a valid configuration as file format has changed. I advise you to make a backup copy before.

Also, note that some keys have changed since previous versions. Read carefully following section.


These are the complete list of key bindings:

  • Movement
    • cursor_up, k
    • cursor_down, j
    • previous_page, backspace, Ctrl-B
    • next_page, space, Ctrl-F
    • home, Ctrl-A: first file
    • end, Ctrl-E: last file
    • cursor_left: upper dir
    • cursor_right: enter dir / vfs
    • Ctrl-S: go to file in current panel
  • Movement in non active pane [1]
    • Alt/Shift-cursor_up, K
    • Alt/Shift-cursor_down, J
    • Alt/Shift-previous_page, B
    • Alt/Shift-next_page, F
    • Alt/Shift-home, A: first file
    • Alt/Shift-end, E: last file
    • Alt/Shift-cursor_left: upper dir
    • Alt/Shift-cursor_right: enter dir / vfs
[1]Some key shorcuts combinations such as Alt or Shift + key may not work, as it depends on the capabilities of the terminal program you are using. F.e. it doesn't work in my computer console running Fedora 10 Linux, but it works under gnome-terminal in X. Your results could be different. Anyway, there are alternative shortcuts (K J B F A E), but not for everything. Consult your terminal emulation program documentation to check it. Also note that you can allow/disallow this navigation with Ctrl-W, it's disabled by default.
  • Changing directory
    • g, G: go to directory
    • 0..9: go to bookmark #
    • Ctrl-D, Ctrl-\: select bookmark # from menu
    • b: set bookmark #
    • Ctrl-Y: display directories history
  • Panes
    • tab: other pane
    • .: toggle display 1 or 2 panes
    • , Ctrl-U: change panes position (left->right, right->left)
    • =: show same directory in both panes
  • Tabs:
    • :: new tab
    • !: close tab
    • <: go to left tab
    • >: go to right tab
  • Selections
    • insert: select item and go to next file
    • +: select group
    • -: deselect group
    • *: invert selection
  • Files / Directories operations
    • t, T: touch file
    • l, L: create link
    • Ctrl-L: edit link
    • F2: rename file/dir/selection
    • F3: view file
    • F4: edit file
    • F5: copy file/dir/selection
    • F6: move file/dir/selection
    • F7: make directory
    • F8, del: delete file/dir/selection
    • enter: execute file, enter dir / vfs or view 'specially' depending on the extension of the regular file. It is executed in a thread that can be stopped and captures output
    • i, I: show file info
  • Other
    • #: show directories size

    • s, S: sort files

    • /: find/grep files

    • @: do something on file. Output is not captured

    • Ctrl-H: toggle show/hide dot files

    • Ctrl-W: toggle allow navigate in non-active pane

    • Ctrl-O: open shell. Type 'exit' to return to lfm

    • Ctrl-T: tree

    • F12: file menu
      • @: do something on file(s)
      • i: file(s) info
      • p: change file permissions, owner, group
      • g: gzip/gunzip file(s)
      • b: bzip2/bunzip2 file(s)
      • x: uncompress .tar.gz, .tar.bz2, .zip, .rar, .7z
      • u: uncompress .tar.gz, etc in other panel
      • c: compress directory to .tar.gz
      • d: compress directory to .tar.bz2
      • z: compress directory to .zip
      • r: compress directory to .rar
      • 7: compress directory to .7z
    • F9: general menu
      • /: find/grep file
      • #: show directories size
      • s: sort files
      • t: tree
      • f: show filesystems info
      • o: open shell
      • c: edit configuration
      • r: regenerate programs
    • Ctrl-R: refresh screen

    • h, H, F1: help

    • q, Q, F10: exit changing to current path

    • Ctrl-Q: quit

  • Keys in EntryLine window:
    • up, down: historic
    • enter: return path
    • tab: change to next entry or button
    • Ctrl-T: complete
    • Ctrl-W: delete whole line
    • Ctrl-K: delete from position to end of line
    • Ctrl-D: delete until next /
    • Ctrl-Z: recover original content (undo)
    • home, Ctrl-A: move start of line
    • end, Ctrl-E: move end of line
    • left, Ctrl-B: move cursor left
    • right, Ctrl-F: move cursor right
    • Ctrl-P, Ctrl-left: move cursor previous /
    • Ctrl-N, Ctrl-right: move cursor next /
    • backspace, del, insert, ...
    • Ctrl-C, ESC: quit
  • Keys in SelectItem window:
    • up, k, K
    • down, j, J
    • previous page, backspace, Ctrl-B
    • next page, space, Ctrl-F
    • home, Ctrl-A
    • end, Ctrl-E
    • Ctrl-S: go to file/dir
    • enter: return path
    • Ctrl-C, q, Q, ESC: quit
  • Keys in Tree panel:
    • down, j, K: down within current depth, without going out from directory
    • up, k, K: up within current depth, without going out from directory
    • previous page, backspace, Ctrl-B: same as up but page-size scroll
    • next page, space, Ctrl-F: same as down but page-size scroll
    • home, Ctrl-A: first directory
    • end, Ctrl-E: last directory
    • left: go out from directory
    • right: enter in directory
    • enter: return changing to directory
    • Ctrl-C, q, Q, F10, ESC: quit


You can navigate inside some special files (known as vfs files in lfm) just entering into them (press enter or cursor_right when the cursor bar is over one of these files). By now, supported types are .tar.gz, .tar.bz2, .zip and .rar files.

The virtual directory name ('path_to_vfs_file#vfs/dir') is not propagated, so tmpdir (/tmp/@6421.2/dir) is showed in the copy/move/... dialogs or when view/edit/... a file, but this is just an estetic issue.

When returning from one of such vfs files, a question dialog appears asking to allow you to regenerate the vfs file and update all changes (i.e., it is compressed again, so it could be slow in some machines), but lfm checks if it can do first, to avoid waste of time. This behaviour (rebuild or not rebuild, ask it or not) can be modified in the configuration file. By default the question is showed but it's set to not regenerate vfs. In case of panelize vfs type (after find/grep), deleted / moved files are not deleted / moved in real path.


Many many years ago I began to write a program like this in C, but after some weeks of coding I never finished it... I'm too lazy, yes. Then I saw the light and I started writing lfm to learn python.

Code evolved and application got more and more features, used by many people around the world on different UNIX systems.

But after the release of version 0.91 (June 2004) they were not more releases. Not that I had stopped working on lfm, new code was written, tested, rewritten again... silently... but different reasons made me to postpone public releases... code refactoring, a new essential feature, source cleaning, a wedding, a child, ahem... more code refactoring....

Anyway, from now on I'll do my best to release often.


Thanks are obviously due to the whole python community, specially to GvR (of course! ;-) and all the people who answered my questions in c.l.p.

It's a great pleasure to code in a language like this.

Alexei Gilchrist, for his cfm program from which I took some ideas.

Midnight Commander developers, whose program was the guide.

And also to all the people who have contributed with ideas, reporting bugs and code over these years: Antoni Aloy, Sebastien Bacher, Grigory Bakunov, Witold Bołt, Fabian Braennstroem, Jason Buberel, Ondrej Certik, Kevin Coyner, Tim Daneliuk, Mike Dean, Arnå DG, Christian Eichert, Steve Emms, Murat Erten, Stephen R. Figgins, f1ufx, Francisco Gama, Vlad Glagolev, Ana Beatriz Guerrero Lopez, Tjabo Kloppenburg, Zoran Kolic, Max Kutny, Martin Lüethi, James Mills, Bartosz Oler, Piotr Ozarowski, Mikhail A. Pokidko, Jerome Prudent, Mikhail Ramendik, Rod, Daniel T. Schmitt, Robin Siebler, Andrey Skvortsov, Espartaco Smith, Jörg Sonnenberger, Tim Terlegård, Edd Thompson, Walter van den Broek, Alejandro Weil, Hai Zaar and many others...

You have made posible to run lfm in all those platforms!