Cactus File Manager is a simple and fast terminal file manager with zero dependencies (apart from a C compiler). It has a sane default configuration based on a Vi-inspired set of keybinds. Configuration is simple, consisting of a config.h file modified before building, much like suckless software.
You can build and install cfm from source or install it via a package manager (if packaged for your package manager). It is highly recommended that you build it yourself, as you can then configure it yourself instead of relying on the default configuration.
To build cfm, download the source and use GNU make or a C compiler directly. To install, either copy the cfm binary to your desired location or use the makefile to install it.
At the moment, cfm is packaged for the following platforms:
Before building, copy config.def.h to config.h and modify as necessary. All options are explained in the comments. If you do not set your editor, shell, or opener in the config file (or you have the default config), you can set the environment variables $EDITOR, $SHELL, and $OPENER. cfm will always look for these at startup if configuration options were not set. If these variables are set but you wish for cfm to use something else, you can prepend the given variable with $CFM_, and it will be used instead. For example, if your $EDITOR is Emacs and you want cfm to use Vi, you can use $CFM_EDITOR set to Vi.
When deleting or cutting files, cfm uses a temporary directory to store them. You may specify a custom directory in config.h using the CFM_TMP option. If you do not specify one, then cfm will first look for the $CFM_TMP environment variable on startup. If this is not found, then it will use /tmp/cfmtmp instead. If cfm cannot create this directory, then it will disable cut/paste and undo, meaning deletion is permanent.
If you come across a bug or have a question/suggestion, please create an issue on GitHub.
The effects of some keys may be different depending on certain options in config.h. Also note that the arrow keys may be used in place of hjkl.
Key(s) | Function |
---|---|
q, Esc | Quit cfm |
h | Go up a directory |
j | Move down |
k | Move up |
l | Enter directory, or open file in EDITOR |
dd | Delete currently selected file or directory (there is no confirmation, be careful) |
T | Creates a new file, opening EDITOR to obtain a filename |
M | Creates a new directory, opening EDITOR to obtain a directory name |
R | Renames a file, opening EDITOR to edit the filename |
gg | Move to top |
G | Move to bottom |
m | Mark for deletion |
D | Delete marked files (does not touch unmarked files) |
u | Undo the last deletion operation (if cfm was unable to access/create its trash directory ~/.cfmtrash, deletion is permanent and this will not work) |
X | Cut the selected file or directory (can be pasted again with p). Does not work if the tmp directory is not available. |
yy | Copy the selected file or directory (can be pasted again with p) |
p | Paste the cut or copied file or directory into the current directory, opening EDITOR for a new name if there's a collision. |
e | Open file or directory in EDITOR |
o | Open file or directory in OPENER |
S | Spawns a SHELL in the current directory |
r | Reload directory |
. | Toggle visibility of hidden files (dotfiles) |
Return | Works like o if ENTER_OPENS was enabled at compile-time, else works like l |
Tab | Switches to the next view |
` | Switches to the previous view |
1...0 | Switches to view N, up to the number specified by VIEW_COUNT (default 2) |
If either STDIN or STDOUT is not attached to a TTY, cfm will run in non-interactive mode, reading commands from STDIN until either EOF or no more input is found. This can be used to write simple scripts. In scripting mode, cfm does not ever draw the screen and any errors are written to STDERR and are fatal.
Cactus File Manager (cfm) is released by Will Eccles under the Mozilla Public License version 2.0. For details, see the LICENSE file distributed with the source code.