Skip to content

Introduction

leo-arch edited this page Oct 10, 2024 · 812 revisions

Introduction

Table of contents


What is clifm?

Command line interface (CLI) Text-based user interface (TUI)
CLI TUI

Clifm, as its very name suggests, is a Command Line Interface File Manager for the Unix terminal.1

Though there is no general agreement regarding the distinction between CLI and TUI interfaces,2 we can stick to the following brief explanation in order to understand what clifm is.

The difference between these two kinds of interfaces relies basically on the way the user interacts with the program, and ultimately, with the resources the program is able to handle (in our case, the files system):

  • A TUI program (aka text-menu driven or curses-based interface) provides the user a semi-graphical interface (as described by the Debian Wiki). By means of this interface the user interacts with the program mainly via text menus (controlled usually via the arrow keys and the mouse) and keyboard shortcuts. Midnight Commander, a Unix clone of the archetypal Norton Commander, is one of the most iconic TUI programs.

  • CLI programs use a command interpreter (or shell) to receive commands entered by the user and then execute the corresponding actions: the user-program interaction is made entirely via text. In other words, a CLI program is a REPL. The basic structure is always the same: Read (user input via a command line), Evaluate/Execute the command, Print the results, Loop (start all over again).3 Your everyday shell (say Bash, ZSH or Fish) is such a REPL or command line program.

Now, whenever we think of terminal file managers, we just do not think of a command line interface, but rather of a TUI; and the reason is quite simple: because in fact, almost all, if not all, terminal file managers happen to be TUI programs.4 But this does not imply at all that these notions are actually the same thing; terminal file managers are not necessarily TUI applications. And clifm is the living proof of this: a truly command line interface file manager that, as such, never hides the command line, but works along with it extending its capabilities: bookmarks, files selection, tags, file filters, bulk rename, directory jumper, autocommands, auto-cd and auto-open, profiles, trash system, resource opener, git integration, plugins, and more.

Briefly put, clifm feels less like a program running on top of the shell and more like this very shell put into file management mode: it is indeed a full-featured CLI file manager for the terminal.

But, why do we want a command line file manager? Kernighan and Pike stated once: "The power of a system comes more from the relationships among programs than from the programs themselves."5 In other words, the power of Unix comes not from the TUI, even less from the GUI, but from the shell, from the command line. Therefore, a file manager entirely based on the command line is no doubt an advantageous way of managing files in a Unix environment.

This is our motto indeed: Stick to the CLI!

1 Clifm was born sometime in 2015 and first made publicly available on September 8, 2016, as a Bash script. Development of the C port (and the complete abandonment of the previous Bash version) started on February 19, 2018. Version 1.0 (Mario) was released on April 10, 2021.

2 Take a look at the resources page.

3 It is in this sense that Aanand Prasad et al state that the metaphor ruling CLI programs is the conversation. See their excellent Command Line Interface Guidelines.

4 Some TUI file managers allow the user to invoke a built-in shell (or CLI) to run shell commands. However, precisely because it needs to be invoked first, the command line is here normally hidden. This is why a CLI workflow do not play well with TUI applications: the command line, if present at all, is there only indirectly, as a secondary feature. With clifm, by contrast, the command line is always already there. In this link you will find a list of sites reviewing some of the most popular file managers for the Unix terminal.

5 The Unix Programming Environment, Prentice-Hall, 1984, p. viii. Cf. pp. 71, 100, and 170 as well. You can also take a look at this excellent article. About the advantages of the CLI see also this Debian wiki article.


Supported platforms

These operating systems and CPU architectures are supported


Is clifm for me?

The answer is quite straightforward: it all depends on your needs. However, you might want to consider the following points:

Reasons to avoid clifm:

  • I'm a Windows user (don't even know what I'm doing here)

  • I'm a GUI user: the command line is just not for me

  • My current file manager does everything I need and in the way I want

  • I'm a power user who sticks 100% to shell commands: to manage my files I only need a regular shell and regular shell commands (like ls, mv, cp, rm, and so on)

  • I don't like new stuff: old, venerable programs are enough for me

  • Clifm is a horrible name (and nobody wants to use a program with a horrible name)

Who is clifm aimed to then?

  • If your workflow is mainly based on the command line, then a command line file manager is naturally a coherent choice. There is no need to hide it: clifm is mainly aimed to advanced, power users, programmers, and system administrators who perform most (if not all) their work in the command line.

Main design and goals

Design decisions

  • The main key to clifm's design is, as you can guess, the decision not to rely on the TUI (curses-based interface). Do we avoid the TUI because it is bad? not at all. The TUI is in fact an amazing interface, and TUI file managers are just great. We decided to leave this interface aside mainly because of two reasons: 1) a non-TUI, purely CLI file manager simply deserves to exist, and 2) we just love the command line, as simple as that. After all, Unix and FLOSS is the land of freedom, and freedom implies choices, and choices imply alternatives.

  • So, without the TUI, the question is: how do we access files? The obvious answer is: "Like in the shell, via file names." But there's still another option: numbers, that is to say, numbers corresponding to each listed file name: it is easier to type just 1 than an entire file name. This is what we call ELN, namely, Entry List Number. And thereby, the TUI was replaced by a fully command line interface using both file names and ELN's.

  • In a purely command line environment we can only type commands; and that's what we did. But in order to make our commands easy and fast we needed to implement really short commands, ideally one character long (most of them however supporting also a long alternative). Some keybindings ended up being useful too.

  • But typing could be cumbersome and tricky sometimes, specially when it comes to long file names or paths. The same goes for numbers (or ELN's): is this number really the number of the file I want? To address this issue, we developed a completion/expansion and Fish-like autosuggestions system based on readline(3). And do not think we didn't try alternatives to readline (editline, linenoise). But for better or worse readline is the most complete line editing library out there, and since we rely 100% on the command line, we really need this powerful library.

Goals

  • Keep it short and simple; do whatever needs to be done in the easiest and shortest way. Overcomplexity is not allowed. Clifm wants simplicity. As a matter of fact, you can start using clifm without the need to learn anything new: the usual shell commands will just work. As you use it, however, you will quickly learn what else it has to offer.

  • Speed and performance: We aimed most of our programming abilities at ensuring the best possible performance. We wanted a really fast and lightweight file manager. Speed and performance is perhaps the main consequence of simplicity.

  • Power, features, and extensibility: A file manager that can perform only basic file operations is just half file manager. If not a file manager, what is supposed to perform the remaining, non-basic file operations? Clifm is intended to be thus a full-featured file manager.
    However, this imposed a challenge on us: how to remain fast and simple and, at the same time, provide advanced features? Some of these features (like the jump function or the suggestions system) are built into the source code (for performance reasons), and others are implemented externally, so to say, via a simple plugins system, in order not to over complicate and overload what should remain as simple as possible. This plugins system is what makes clifm a flexible and extensible file manager.

  • Customization: Customization is not really a need, or at least, not a program's need. It is however more like a good and friendly gesture towards the user. The ability to make the program fit my needs and preferences, to adapt it to my own system and environment, the ability to play and tinker with the program, is something that, for very good reasons, users really appreciate. The more a program is "mine", the less alien it feels to me. And after all, every piece of (free) software is (or at least should be) aimed at the users.

  • Portability: Portability is also important to us. We try to keep clifm running on as many operating systems/CPU architectures as possible. Currently tested and running flawlessly on these platforms.

  • Privacy and security: Zero data collection. By itself, clifm will never submit any data over the Internet, simply because it's not connected to the outside world at all. You can even run incognito via the stealth mode, or just disable commands history by entering history off. Concerned about security? We too. Take a look at our security section.

  • Code quality: Though perfect, bug-free code is nearly impossible, we do try to do our best in this field. Consult our code quality standards for more details.

  • Needles to say, to build a friendly, collaborative community around clifm is one of our main aims.


Runtime dependencies

This is the list of external applications used by clifm.

Utility Operation Install reason
cp, mv, rm Basic operations Required
advcpmv, wcp, rsync Copy, move with progress bar Optional
$CLIFM_SHELL | $SHELL | sh Shell commands Optional
7z, mount, dd, mkisofs, zstd, atool, archivemount Archiving Optional
vlock (Linux) | bashlock (macOS) | lock(1) (BSD) | peaclock (Haiku) Lock terminal (Alt-o) Optional
udevil | udiskctl (Un)mount removable devices Optional
rsync Duplicate files Optional
du Directory size Optional
find Recursive search Optional
man Quick manpage access (F1-F3) Optional
fzf | fnf | smenu TAB completion Optional1
Plugins Optional2
Resource opener Optional2

1 Though optional, fzf is highly recommended, as is tightly integrated into clifm (including file/image previews).

2 Applications used here are user dependent and thoroughly configurable.


Installation

1. From a package manager.

Note: For Archlinux users, the latest released version (clifm), just as a binary version (clifm-bin) and the development version (clifm-git), is available in the AUR. Binary packages can also be found in the following unofficial repositories: chaotic-aur, andontie-aur, and TheRepoClub.

2. Binary packages for some of the major Linux distributions (Archlinux, CentOS, Debian, Fedora, OpenSUSE, and Ubuntu) are available via the OpenSUSE Build System.

Compiling/installing from source

If you prefer to build and install the package yourself (it should take less than a minute), or if you want to try the latest version, or if there is no binary package available for your OS/distribution, follow these steps.

1. Satisfy build dependencies

Install the following build dependencies using the package manager provided by your OS/distribution:

Package(s) Operating system Install reason Description
git, make, gcc / clang Compilation
coreutils Base Basic file operation commands
libcap, acl, readline, file Archlinux-based Base
acl-dev, file-dev, gettext-tiny-dev, libcap-dev, readline-dev, musl-dev Alpine Base
acl-devel, file-devel, libcap-devel, readline-devel, musl-devel Void Base
libcap-dev, libacl1-dev, libreadline-dev, libmagic-dev Debian/Ubuntu-based Base
libcap-devel, libacl-devel, readline-devel, file-devel Fedora / RHEL / CentOS Base
libcap-devel, acl-devel, readline-devel, file-devel OpenSUSE Base
sys-libs/libcap, sys-libs/readline, sys-apps/acl, sys-apps/file Gentoo-based Base
devel/gettext-runtime, devel/readline, file FreeBSD Base
gettext, readline, file NetBSD Base
gettext-runtime, readline, libmagic OpenBSD Base
readline, magic Solaris/Illumos Base Both Solaris 10 and Openindiana ship an outdated version of readline, which migh cause some issues with the prompt. Consult the troubleshooting section.
gettext, readline7, readline7_devel, file_devel Haiku Base
libcap, libacl, readline, file Termux Base
gcc-g++, git, make, file-devel, gettext-devel, libreadline-devel, file-devel Cygwin Compilation/Base For MinGW specific instructions see this issue
MacPorts, gmake, gettext, readline, libmagic MacOS Compilation/Base
atool, archivemount, p7zip, cdrtools / cdrkit Optional Archiving and compression support
icons-in-terminal / Nerd Fonts Optional Icons support
fzf / smenu / fnf Optional Alternative modes for TAB completion. FZF is used by several plugins
udevil / udisks2 Optional (Linux only) Mount/unmount local file systems without password (via the media command)

2. Compile and install

🔹 a. Linux/BSD

git clone https://github.com/leo-arch/clifm.git
cd clifm
sudo make install

To uninstall the package run

sudo make uninstall

NOTE: If running on OpenBSD, you probably need to replace sudo by doas.

🔹 b. Solaris/Illumos

git clone https://github.com/leo-arch/clifm.git
cd clifm
sudo gmake -f misc/solaris/Makefile install

To uninstall the package run

sudo gmake -f misc/solaris/Makefile uninstall

🔹 c. Termux

pkg install libcap libacl readline file
git clone https://github.com/leo-arch/clifm.git
cd clifm
make -f misc/termux/Makefile install

To uninstall the package run

make -f misc/termux/Makefile uninstall

🔹 d. Cygwin

  1. Install the following packages: gcc-g++, git, make, file-devel, gettext-devel, libreadline-devel, and file-devel.

  2. Run these commands:

git clone https://github.com/leo-arch/clifm.git
cd clifm
make -f misc/cygwin/Makefile install

To uninstall the package run

make -f misc/cygwin/Makefile uninstall

Note: The fzf package provided by Cygwin is quite outdated. If you cannot install the latest version, try one of the alternative TAB completion modes: standard, smenu, or fnf.

🔹 e. Haiku

pkgman install gettext readline7 readline7_devel file_devel
git clone https://github.com/leo-arch/clifm.git
cd clifm
make -f misc/haiku/Makefile install

To uninstall the package run

make -f misc/haiku/Makefile uninstall

🔹 f. MacOS

If you experience any problem with homebrew, there are a few altenative methods:

a. MacPorts

  1. Install MacPorts from https://www.macports.org/
  2. Install clifm:
sudo port install clifm

b. From source

See https://github.com/leo-arch/clifm/issues/183#issuecomment-1364012608.


Custom installation directory

By default, files are installed in /usr/local.1 To install somewhere else you can pass a different path to make via PREFIX. For example, Archlinux installs binaries in /usr/bin instead of /usr/local/bin. In this case, run make as follows:

make PREFIX=/usr install

1 In Termux it is rather /data/data/com.termux/files/usr.


Manual compilation

If you are a real DIY and prefer to skip the Makefile automation using some compiler like gcc or clang, or if you want to compile some feature in-out, take a look at the compilation page.


❔ Getting help

There are several ways of getting help in clifm.

First and foremost, consult the manpage as usual:

man clifm

The following commands/keybindings are also available:

Command / Keybinding Action
? / help Print some basic usage examples
cmd<TAB> Get the list of available commands together with a brief description (since version 1.9.2)
help TOPIC Get help for a given topic. Type help <TAB> to get a list of available help topics
CMD -h / --help Access the help section for the command CMD
F1 Access the manpage (the full description/help is here)
F2 Jump to the COMMANDS section in the manpage
F3 Jump to the KEYBOARD SHORTCUTS section

A convenient way of getting full information about clifm commands is via the ih action, bound by default to the interactive help plugin (ihelp.sh).

Type ih to run the plugin (it depends on FZF) and select the command you want to obtain information about.


Interface

interface

EDIT: Messages, trash, and selected files indicators include now a counter indicating the amount of items of the corresponding function. For example, if you selected 13 files, you'll see *13, and if you trashed 3 files, you'll see T3.

Though this is the default interface, it could be heavily customized. Consult the customization page.


Command line options

Positional parameters

If the first non-option parameter is a directory, clifm will start in this directory. For example, the command clifm /etc instructs clifm to start in the directory /etc.

If not specified, the first workspace will be used. To start in a different workspace, use the -w option. For instance: clifm -w4 /etc.

Note: If compiled in POSIX mode, the below list of options does not apply. In this case, run clifm -h to get the actual list of command line options. (To make sure run clifm -v: if compiled in POSIX mode the version number is followed by "-POSIX").

Short Long Description
-a --show-hidden Show hidden files
-A --no-hidden Do not show hidden files
-b --bookmarks-file=FILE Specify an alternative bookmarks file
-c --config-file=FILE Specify an alternative configuration file
-D --config-dir=DIR Use DIR as an alternative configuration directory. If configuration files do not exist already, they will be created anew here
-e --no-eln Do not print ELN at the left of each file name
-E --eln-use-workspace-color ELN's use the current workspace color
-f --dirs-first List directories first (default)
-F --no-dirs-first Do not list directories first
-g --pager Enable Mas, the files list pager
-G --no-pager Disable the pager (default)
-h --help Print a help summary and exit. For the complete help consult the manpage
-H --horizontal-list List files horizontally instead of vertically
-i --no-case-sensitive Ignore case distinctions when listing files (default)
-I --case-sensitive Do not ignore case distinctions when listing files
-k --keybindings-file=FILE Specify an alternative keybindings file
-l --long-view Enable long/detail view mode
-L --follow-symlinks-long If running in long view, show information for the file a symbolic link references rather than for the link itself
-m --dirhist-map Enable the directory history map
-o --autols cd lists files automatically (default)
-O --no-autols cd does not list files automatically (just like the shell cd(1) command)
-p --path=DIR Use DIR as clifm starting path. This option is deprecated: use positional parameters instead. For example: clifm /some/dir
-P --profile=PROFILE Use (or create) PROFILE as profile
-r --no-refresh-on-emtpy-line Do not refresh the current list of files when pressing Enter on an empty line
-s --splash Enable the default splash screen. A custom splash screen can be set using the profile file.
-S --stealth-mode Leave no trace on the host system. Nothing is read from any file nor any file is created: all settings are set to default values. However, most settings can be controlled via command line options and environment variables
-t --disk-usage-analyzer Run in disk usage analyzer mode
-T --trash-dir=DIR Use DIR as an alternative trash directory
-v --version Show version details and exit
-w --workspace=NUM Start in workspace NUM
-x --no-ext-cmds Disallow the use of external, shell commands
-y --light-mode Run in light mode to get some extra speed
-z --sort=METHOD Sort files by METHOD. Example: --sort=inode
--bell=STYLE Set the terminal bell style, where STYLE is one of: 0 = none, 1 = audible, 2 = visual (requires readline >= 8.1), 3 = flash. Defaults to 2, and, if not possible, 0
--case-sens-dirjump Do not ignore case when consulting the jump database
--case-sens-path-comp Do not ignore case when completing file names
--cd-on-quit Write last visited path to $XDG_CONFIG_HOME/clifm/.last to be accessed later by a shell function
--color-scheme=NAME Use color scheme NAME
--color-links-as-target Colorize symbolic links using the target file color
--cwd-in-title Print the current directory in the terminal window title
--data-dir=DIR Load data files, such as plugins, color schemes, and default configuration files, from DIR. Usually, this directory is /usr/local/share or /usr/share
--desktop-notifications Enable desktop notifications
--disk-usage Show disk usage for the filesystem the current directory belongs to (in the form FREE/TOTAL (FREE_PERCENTAGE) FS_TYPE DEV_NAME)
--full-dir-size If running in long view mode, print the size of directories and their contents
--fuzzy-algo Fuzzy matching algorithm: either 1 (faster, but not Unicode aware) or 2 (slower, Unicode aware). Defaults to 2
--fuzzy-matching Enable fuzzy matching for filename/path completions and suggestions
--fzfpreview-hidden Enable file previews for TAB completion (fzf mode only) with the preview window hidden (toggle it via Alt-p)
--fzftab Use fzf for TAB completion (default if fzf binary is found).
--fnftab Use fnf for TAB completion
--icons Enable icons
--icons-use-file-color Icons color follow the corresponding file color (only if compiled with icons-in-terminal or nerd-fonts support)
--int-vars Enable the use of internal variables
--list-and-quit List files and quit. Example: clifm --list-and-quit /media
--ls Short for --list-and-quit
--lscolors Read file colors from LS_COLORS. Consult the Colors section for more information.
--max-dirhist Maximum number of visited directories to remember
--max-files=NUM List only up to NUM files
--max-path=NUM Set the maximum number of characters after which the current directory in the prompt line will be abbreviated to the directory base name (if \z is used in the prompt)
--mnt-udisks2 Use udisks2 instead of udevil (default) for the media command
--no-apparent-size Print file sizes as used blocks instead of used bytes (apparent size)
--no-bold Disable bold colors (applies to all color schemes)
--no-cd-auto By default, clifm changes directories by just specifying the corresponding ELN or file name (e.g. 12 instead of cd 12). This option forces the use of cd
--no-classify Do not append file type indicators1
--no-clear-screen Do not clear the screen before listing directories
--no-color Disable colors1
--no-columns Disable columned files listing
--no-dir-jumper Disable the directory jumper function
--no-file-cap Do not check for files capabilities when listing files
--no-file-ext Do not check files extension when listing files
--no-files-counter Disable the files counter for directories. This option is especially useful to speed up the listing process; counting files in directories is expensive
--no-follow-symlinks Do not follow symlinks when listing files (symbolic links to directories will be listed as regular files). This option overrides both -L,--follow-symlinks-long and --color-links-as-target.
--no-fzfpreview Disable file previews for TAB completion (fzf mode only)
--no-highlight Disable syntax highlighting
--no-history Do not write commands into the history file
--no-open-auto Same as no-cd-auto, but for regular files
--no-refresh-on-resize Do not attempt to refresh the files list upon window's resize
--no-restore-last-path By default, clifm saves the last visited directory to be restored in the next session. Use this option to disable this feature
--no-suggestions Disable the autosuggestions system
--no-tips Disable startup tips
--no-trim-names Do not trim file names longer than MaxFilenameLen (see the configuration file)
--no-warning-prompt Disable the warning prompt (used to highlight invalid command names)
--no-welcome-message Disable the welcome message
--only-dirs List only directories and symbolic links to directories
--open=FILE Run as a standalone resource opener: open FILE and exit, where FILE could be a regular file or a directory, using either standard notation (/dir/file) or the URI file scheme (file:///dir/file), or a URL (www.domain or https://domain)
--opener=APPLICATION Resource opener to use instead of Lira, clifm's built-in opener
--pager-view=MODE How to list files in the pager. Possible values: auto (default), long, and short.
--physical-size Same as --no-apparent-size
--preview=FILE Run as a standalone file previewer: display a preview of FILE (via shotgun) and exit. It can be used with --shotgun-file to set a custom configuration file for shotgun
--print-sel Always print the list of selected files after the current list of files. Since this list could be quite extensive, set a limit to it via the MaxPrintSelfiles option in the configuration file. Defaults to 0 (never take more than half terminal height). Use -1 to remove the limit, or any positive value
--prop-fields=FORMAT Set a custom format string for long view. Consult the File details section for information on how to construct this format string.
--ptime-style=STYLE Date/time style used by the p/pp command. See the p command for information about available styles.
--readonly Run in read-only mode
--rl-vi-mode Set readline to vi editing mode (defaults to emacs editing mode)
--secure-cmds Filter commands sent to the OS to minimize the danger of command injection when running in untrusted environments. Consult the secure commands section
--secure-env Run clifm in a secure environment (regular mode). Consult the secure environment section
--secure-env-full Run clifm in a secure environment (full mode). Consult the secure environment section
--sel-file=FILE Set FILE as custom selections file (since version 1.9.1)
--share-selbox Make the Selection Box common to different profiles
--shotgun-file=FILE Set FILE as shotgun's configuration file. Only effective if used with --preview
--si Calculate sizes in powers of 1000 instead of 1024, as defined by the International System of Units (SI)
--smenutab Use smenu for TAB completion
--sort-reverse Sort in reverse order, for example: z-a instead of a-z (being this latter the default order)
--stat FILE... Run the p command on FILE(s) and exit. This must be the last option on the command line.
--stat-full FILE... Run the pp command on FILE(s) and exit. This must be the last option on the command line.
--stdtab Use the standard mode (readline) for TAB completion
--time-style=STYLE Date/time style used in long view. See Time styles for more information.
--trash-as-rm The r command executes trash instead of rm to prevent accidental deletions
--virtual-dir=DIR Use DIR as clifm's virtual directory
--virtual-dir-full-paths Print file names in virtual directories as full paths instead of just base names
--vt100 Run in VT100 mode

1 When colors are disabled, the following file type indicators (if classify is enabled, which is the default) are used:

Indicator File type
/ Directory
@ Symbolic link
! Broken symbolic link
* Executable file
= Socket
+ Block device
- Character device
| FIFO/pipe
? Unknown

Commands: Short summary

For more information about each of these commands click on the link provided by the Full description column. You could also take a look at these few basic usage examples.

Help for all internal commands can be accessed via the -h or --help options.

NOTE: TAB completion and auto-suggestions are available for long commands.

NOTE 2: Arguments enclosed in square brackets ([]) are optional.

NOTE 3: When running commands via sudo (or doas) no clifm (internal) command will work, for the simple reason that sudo (or doas) doesn't know anything about these commands: they only know about commands in PATH. However, you can always run clifm as root (e.g. sudo clifm) or run a new instance of the program via the X command (note the uppercase).

Short format Long format Options Short description Example Full description
... This is the fastback function, which allows you to quickly change to any parent directory ... > ~/Dowloads Here
FILE/DIR Open FILE or change to DIR. Auto-open (ao) and autocd (acd) must be set to on (default) /media or 12 (provided 12 is a valid ELN) Here
/ PATTERN [-filetype] [-x] [DIR] Search for files /*.png Here
;, : [CMD] Run CMD via the system shell. If no CMD, just spawn a new system shell ;chmod 644 file Here
ac, ad ELN/FILE... Archive/compress (ac) or dearchive/decompress (ad) files ac sel (archive/compress selected files - Ctrl-Alt-a) or ad myfile.tar.gz (decompress/dearchive this file) Here
acd autocd [on, off, status] Toggle autocd on/off acd off Here
actions [list] [edit [APP]] List actions or edit the actions file actions edit Here
alias [import FILE] [list] [NAME] Print, list, or import aliases from FILE alias import ~/.bashrc Here
ao auto-open [on, off, status] Toggle auto-open on/off ao off Here
b back [h, hist] [clear] [!ELN] Go back to the previously visited directory b - Shift-Left or Alt-j Here
bb bleach ELN/FILE... Rename file names using only safe characters bb Downloads/* Here
bd NAME Change to parent directory matching NAME bd git Here
bl ELN/FILE... Create symbolic links (in the current directory) for each specified file bl file file2 dir/ 23 Here
bm bookmarks [a, add PATH] [d, del] [edit] [NAME] Manage bookmarks bm mybookmark - Alt-b Here
br bulk ELN/FILE... [:EDITOR] Bulk rename files br sel Here
c, m, r, md Copy, move/rename, delete files, and create directories respectively m 34 2 (move the file whose ELN is 34 to the directory whose ELN is 2) Here
colors Print the list of currently used color codes colors Here
cd [ELN/DIR] Change directory to ELN/DIR cd 2 or cd mydir Here
cl columns [on, off] Toggle columns on/off cl off Here
cmd commands Jump to the COMMANDS section in the manpage cmd Here
config [edit [APP]] [dump] [reset] Open/edit the main configuration file config edit - F10 Here
cs colorschemes [edit [APP]] [name] [preview] [NAME] List, set or edit color schemes cs nord (change color scheme to nord) Here
d dup FILE... Duplicate files d file1 file2 Here
dh [STRING] [PATH] [!ELN] Access the directory history list dh <TAB> Here
ds desel [*, a, all] [FILE ...] Deselect one or more selected files ds * - Alt-d Here
exp [FILE...] Export FILE(s) to a temporary file exp sel - Ctrl-Alt-e Here
ext [on, off, status] Toggle external commands on/off ext off Here
f forth [h, hist] [clear] [!ELN] Move forward in the directory history list f - Shift-Right or Alt-k Here
fc [on, off, status] Toggle the files counter on/off fc off - Alt-g Here
ff dirs-first [on, off, status] Toggle list directories first on/off ff on - Alt-g Here
fs Print an extract from 'What is Free Software?', written by Richard Stallman fs Here
ft filter [unset] [[!]REGEX,=FILE-TYPE-CHAR] Filter the current list of files ft .*\. (list only hidden files) or ft !.*\. (exclude hidden files) Here
fz [on, off] Toggle full directory size on/off (only for long view mode) fz on Here
hf, hh hidden [on, off, status] Toggle hidden files on/off hh - Alt-. Here
history [edit] [clear] [-n] [on, off, status, show-time] List, edit or clear the commands history list history -10 show-time (list last 10 entries, with timestamps) Here
icons [on, off] Toggle icons on/off Here
j, jc, jl, jp, je Directory jumper j ho sr (jump to a directory in the jump database matching ho and sr) Here
k Toggle follow-links (long view only) Here
kk Toggle max-filename-len Here
kb keybinds [list] [edit [APP]] [conflict] [reset] [readline] Handle keybindings kb edit - F9 Here
l, le Create/edit symbolic links l target_file link_name Here
ll, lv Toggle long/detail view mode ll - Alt-l Here
lm [on, off] Toggle the light mode on/off lm on - Alt-y Here
log [cmd, msg [list, on, off, status, clear]] Enable, disable, clear, list or check status of program logs log Here
media Handle storage devices media Here
mf [NUM, unset] List only up to NUM files (unset removes the limit) mf 20 Here
mm mime [open FILE] [info FILE] [edit] [import] Manage default opening applications mm info 12, mm edit - F6 Here
mp mountpoints List available mountpoints and change the current working directory to the selected mountpoint mp - Alt-m Here
msg messages [clear] List or clear program messages msg clear - Alt-t Here
n new [FILE DIR/] Create new files and/or directories n file or n dir/ - Alt-n Here
net [NAME] [list] [edit [APP]] [m, mount NAME] [u, unmount NAME] Manage remote file systems net mount smb_work Here
o open ELN/FILE [APPLICATION] Open FILE o5 Here
oc FILE... Interactively change files ownership oc file.txt Here
opener [default] [APPLICATION] Set opener to APPLICATION (or Lira if set to default) opener xdg-open Here
ow ELN/FILE [APPLICATION] Open FILE with selected application ow 5 Here
p prop FILE... Print file properties for FILE p34 or p34-36 40 Here
path, cwd Print the current working directory. cwd Here
pc FILE... Interactively change files permissions pc file.txt Here
pf profile [list] [set, add, del PROFILE] [rename PROFILE NEW_NAME] Handle profiles pf set myprofile - Ctrl-Alt-[o/p] Here
pg pager [on, off, status, NUM] Handle Mas, the built-in pager pg on Here
pin [FILE/DIR] Pin a file or directory pin DIR Here
prompt [set NAME, list, edit, reload, unset] Temporarily change the current prompt prompt coolprompt Here
q, Q, quit, exit Gracefully quit clifm. Use Q to enable the CD on quit functionality q - F12 Here
rf refresh Refresh the screen, that is, reprint files in the current directory and update the prompt. If the autocd function is enabled, rf is equivalent to . rf - Ctrl-r Here
rl reload Reload all settings, except those passed as command line arguments, from the configuration file rl Here
rr [DIR] [:EDITOR] Bulk remove files via a text editor rr mydir :vi Here
s sel ELN/FILE... [[!]PATTERN] [-filetype] [:PATH] Select files s *.png Here
sb selbox Show the elements currently contained in the Selection Box sb - Alt-s Here
splash Show the splash screen splash Here
st sort [METHOD] [rev] Set sort method to METHOD st size - Alt-[x/z] Here
stats Print statistics for files in the current directory stats Here
t trash [ELN/FILE ... n] [list] [clear, empty] [del [FILE(s)]] Move files to the trash can t34 Here
tag [add, del, list, list-full, merge, new, rename, untag] [FILE]... [[:]TAG] Main command of the files tagging system tag add file1 file2 :images Here
te FILE... Toggle executable bit on FILE(s) te45 Here
tips Print the list of clifm tips tips Here
u undel, untrash [*, a, all] [FILE(s)] Restore (undelete/untrash) trashed files u * - Alt-u Here
unpin Unpin pinned directory unpin Here
vv FILE... DIR Copy FILE(s) into DIR and bulk rename them at once vv sel mydir Here
ver version Show clifm version details ver Here
view [edit [APP]] Preview files in the current directory in full screen view Here
ws [NUM/NAME, +, -] Switch workspaces ws3 - Alt-n, where n is the workspace number Here
x, X [DIR] Open DIR, or the current directory if DIR is not specified, in a new instance of clifm (as root if X, as unprivileged user if x) x - Ctrl-x Here

NOTE: Some shell builtin commands have been implemented to make them work in clifm: pwd, export, unset, and umask. For more information use the --help option with any of these commands.

Commands: Detailed description

Preliminary notes:

ELN

ELN stands for Entry List Number. For example: in the line 12 openbox (when listing files), 12 is the ELN corresponding to the file named openbox. The slash followed by a number (/xx) after directories and symbolic links to directories (the files counter) indicates the amount of files contained by the corresponding directory, excluding self and parent directories (. and .. respectively).

ELN-filename conflict

In case of ELN-filename conflict the backslash can be used to prevent ELN expansion. For example, if we have at least two files, and one of them in named 2, then clifm cannot know in advance if the command refers to the ELN 2 or to the file named 2. In we want the ELN, we just write the ELN number, for example: s2. But if we want the file name, we need to escape the file name using the backlash character: s \2.

Fused parameters

Clifm supports fused parameters for internal commands taking an ELN or range of ELN's as parameters. Much like short options for command line programs, you can drop or omit the space between internal commands and the corresponding ELN passed as argument. In general, you can write CMDELN instead of CMD ELN. For example: o12 or s1-5 instead of o 12 and s 1-5 respectively. Bear in mind, however, that in thus omitting the space char TAB completion and auto-suggestions for ELN's won't be available. If there is a file named o12 (more generally, CMDELN), and if you want to refer to this file instead of a clifm command, escape the file name to prevent the split; for example: s \o12.

Commands history

Just like most shells out there, clifm keeps a record, not only of visited directories, but also of entered commands. Use the Up and Down keys to move backwards and forwards through this list. However, not everything is recorded: there is no need to fullfil this list with useless commands. This is the list of excluded entries:

  1. Commands starting with space: usefull when you want to explictly avoid recording your command
  2. A few fixed commands: rf, history, and .
  3. Single ELN's such as 9, 74 or 75
  4. History expansion commands (!)
  5. Consequtively equal commands

List of commands


Fastback

Clifm implements a fastback function, that is to say, the conversion of ... n or cmd ... n into ../.. n or cmd ../.. n. In other words, subsequent dots after .. will be converted each into /... For example, if you are in your home directory and type ... or cd ..., and since ... amounts to ../.., you will be taken to the root directory. TAB completion and suggestions are available for this function.

A similar function is provided by the backdir function.

FILE/DIR

If the autocd and auto-open functions are enabled, which is the default, open FILE or change directory to DIR. In other words, FILE amounts to open FILE or o FILE, and DIR to cd DIR. ELN's, of course, are allowed. Example: 12. See the open and cd commands respectively. If the file is not a directory, it will be opened with the default associated application (see the mime command). To open the file with a different application, use the ow command or append the desired application to the end of the input string. E.g.: file app. Of course, app file also works.


/PATTERN

Arguments: [-filetype] [-x] [DIR]

This is the quick search function. Type / followed by a search pattern and clifm will list all matches in the current working directory (or in DIR, if specified).

Three search strategies are available: glob-only, regex-only, and glob-regex (default). The first evaluates search patterns only as glob expressions (e.g. /*.pdf), the second only as regular expressions (e.g. /.*\.pdf$), and the third first as glob and, if no matches are found, as regular expressions. This behavior can be customized in the configuration file, via the SearchStrategy option.

Expressions containing no pattern metacharacter are automatically replaced by /.*EXP.*. For example /test becomes /.*test.* (or /*test* if the search strategy is glob-only).

Note: If no parameter is provided (see below), but only a glob pattern (wildrcards) this pattern can be expanded into the corresponding matches via the TAB key. For example, if you want to list all C files in the current directory:

/*.c<TAB>

To search for files in any directory other than the current one, specify the directory name as a further parameter. This parameter (DIR) could be an absolute path, a relative path, or an ELN. For example, enter

/^A 7

to search for all files starting with A in the directory whose ELN is 7.

The result of the search could be further filtered by specifying a filter type:

Filter Target
-d Directory
-r Regular file
-l Symbolic link
-s Socket
-f FIFO/pipe
-b Block device
-c Character device

For example,

/[.-].*d$ -d Documents/

will list all directories containing a dot or a dash and ending with d in the directory named Documents.

Invert match

The quick search function also supports invert match, in which case only non-matching entries will be displayed: prepend the exclamation mark (!) to negate a given search pattern. For example:

!.*s$ -d /etc

will match all directories in /etc not ending with s, just as !D* will match all files in the current directory not starting with D.

Recursive search

To perform a recursive search use the -x parameter, and, optionally, a search path (DIR). The search will be performed using find(1) as follows: find DIR -name PATTERN. If no search path is provided, the search is executed starting in the current directory.


;[CMD], :[CMD]

If no CMD, but just ; or :, run the default shell in the current working directory. If CMD is specified, skip all clifm expansions and run the input string (CMD) as is via the default system shell. For example, ;ls 2 will not expand 2 to the filename whose ELN is 2, but will pass the entire string to the system shell, say Bash, as follows: sh -c 'ls 2'.


ac, ad

Arguments: ELN/FILE ... n

Archive/compress and dearchive/decompress one or multiple files and/or directories. The archiver function brings two modes: ac, to generate archives or compressed files, and ad, to decompress or dearchive files, either just listing, extracting, recompressing, or mounting their content. In this latter case, the mountpoint used automatically is $HOME/.config/clifm/PROFILE/mounts/ARCHIVE_NAME.

The function accepts single and multiple file names, wildcards, ELN ranges, and the sel keyword. For example: ac sel, ac 4-25 myfile, or ad *.tar.gz. Multiple archive/compression formats are supported, including Zstandard. When it comes to ISO 9660 files only single files are supported.

The archive mount function for non ISO files depends on archivemount, while the remaining functions depend on atool and other third-party utilities for archive formats support, for example, p7zip. p7zip is also used to manage most decompressing options for ISO 9660 files, except for mount, in which case mount(8) is used. Creation of ISO files is done via genisoimage(1). For more information consult atool(1), archivemount(1), zstd(1), and 7z(1).


acd, autocd

Arguments: [on, off, status]

Toggle the autocd function on/off. If set to on, DIR amounts to cd DIR.


actions

Arguments: [list] [edit [APP]]

To list available action actions (aka plugins), use the list subcommand. Note that, since list is the default action, it can be omitted.

Use the edit subcommand to add, remove or modify custom actions (using APP is specified or the default associated application otherwise).

The aim of this function is to allow the user to easily add custom commands and functions to clifm. In other words, the actions function is a plugins capability.

The general procedure is as follows:

a) Bind a custom action name to an executable file written in any language you want, be it a shell or a Python script, a C program or whatever you like (using the actions.clifm file located in the configuration directory). For example:

myaction=myscript.sh

b) Now, drop the corresponding script (in our example, myscript.sh) into the plugins directory (see the files section).

c) Once this is done, you can call the script using the custom action name defined before as if it were any other command: run myaction, and myscript.sh will be executed.

All arguments passed to the action command are passed to the script or program as well (which is run via the system shell).

The plugins provided with clifm could be used as a starting point to create custom plugins.


alias

Arguments: [import FILE] [list] [NAME]

Consult the aliases section.


ao, auto-open

Arguments: [on, off, status]

Toggle the auto-open function on/off. If set to on, FILE amounts to open FILE.


b, back

Arguments: [h, hist] [clear] [!ELN]

Unlike cd .., which sends you to the parent directory of the current directory, the back command (with no argument) sends you back to the previously visited directory.

Clifm keeps a record of all visited directories. You can see this list by typing b hist, or b h, and you can access any element in this list by passing the corresponding ELN in this list (preceded by an exclamation mark) to the back command. Example:

:) > ~ $ bh
1 /home/user
2 /etc
3 /proc
:) > ~ $ b !3
:) > /proc $

NOTE: The highlighted line indicates the current position of the back function in the directory history list.

Finally, you can also clear this history list by typing b clear.

If you want to go forth, instead of backwards, in the directory history list, use the forth command: in short, enter f or press Shift-Right (or Alt-k).

To prevent directories from being added to the directory history list, use the DirhistIgnore option in the main configuration file.

The best way of navigating the directory history list, however, is via the directory jumper function using the j command. Take a look at the dh command as well.


bb, bleach

Arguments: ELN/FILE ... n

Bleach is a built-in file names cleaner (based on detox), whose main aim is to rename file names using only safe characters.

Bleach cleans file names up either by removing unsafe (extended-ASCII/Unicode) characters without an ASCII alternative/similar character, or by translating these unsafe characters into an alternative ASCII character based on familiarity/similarity.1

These following rules are used to compose clean/safe file names:

  • NUL (\0) and slash (/) characters are completely disallowed
  • Only characters from the Portable Filename Characters Set (a-zA-Z0-9._-) are allowed
  • { [ ( ) ] } are replaced by a dash (-). Everything else is replaced by an underscore (_)
  • Unicode characters are translated, whenever possible, into an ASCII replacement. Otherwise, they are just ignored. For example, Á will be replaced by A (ě by e, Ĭ by I, and so on),2 but 😀 (the smiley face) will be simply ignored. A few special signs will be translated into text, for instance, £ will be replaced by _pound_ and by EUR. Translations are made via a translation table
  • File names never start with a dash (-)
  • Files named . and .. are not allowed
  • Append .bleach to one character long file names
  • Do not let a replacement file name start with a dot (hidden) if the original does not
  • Max file name length is NAME_MAX (usually 255)

Modified file names will be listed on screen asking the user for confirmation, allowing besides to edit (by pressing e) the list of modified file names via a text editor.

If the replacement file name already exists, a dash and a number (starting from 1) will be appended. E.g.: file-3.

NOTE: For more information about Unix file names consut the resources page.

Usage examples:

Clean up a couple of files:

bb 12-17

or, to clean up only PDF files:

bb *.pdf

Since downloaded files are often a source of issues:

bb Downloads/*

1 pathchk(1) is another useful tool when it comes to unsafe file names.
1 Following the convention, the german vowels ä, ö, ü (and upper case variants) are translated as ae, oe, and ue, respectively.


bd

Arguments: [QUERY]

bd is the backdir function: it takes you back to the parent directory matching QUERY.

With no arguments, bd prints a menu with all parent directories relative to the current directory, allowing the user to choose an entry. Otherwise, it checks the absolute current directory against the provided query string (QUERY): if only one match is found, it automatically changes to that directory; if multiple matches are found, the list of matches is printed in a selection menu. If QUERY is a directory name, bd just changes to that directory, be it a parent of the current directory or not.

TAB completion and suggestions are available for this function.

Example:

Provided that the current directory is /home/user/git/repositories/lambda, entering bd git will take you immediatelly to /home/user/git.

Note that there is no need to type the entire directory name; if the query is unambiguous, only a few characters, and even just one, suffices to match the appropriate directory. In our example, bd g is enough to take you to /home/user/git, just as bd h will take you to /home.

The query string could match any part of a directory name: bd er, for instance, will take you to /home/user, since it is an unambiguous query.

Take a look also at the fastback function.


bl

Arguments: FILE...

Create symbolic links (in the current directory) for each specified file. Examples:

Create symbolic links, in the current directory, for all files starting with file

bl file*

Create symbolic links in the directory dir for all .png files

s *.png
cd dir
bl sel

bm, bookmarks

Please refer to the bookmarks section


br, bulk

Arguments: FILE... [:EDITOR]

Bulk rename FILE(s)

Each file name will be copied into a temporary file, which will be opened via EDITOR (default associated application for plain text files if omitted), letting the user modify it. Once the file has been modified and saved, the modifications are printed on the screen and the user is asked for confirmation. Examples:

Bulk rename all files ending with .pdf in the current directory:

br *.pdf

or br <TAB> to choose from a list (mutli-selection is allowed)

Bulk rename all selected files:

br sel

or, using vi:

br sel :vi

NOTE: This built-in bulk rename function won't deal with deletions, replacements, file name conflicts and the like. For a smarter alternative use qmv(1).


c, m, md, r

c, m, md, and r commands are wrappers for cp(1), mv(1), mkdir(1), and rm(1) shell commands respectively. The exact shell commands run by each of these internal commands are the following:

Internal command Shell command Observations
c cp -iRp When using the sel keyword and no destiny is provided, c will copy selected files into the current directory.
m mv -i When using the sel keyword and no destiny is provided, m will move selected files into the current directory (i.e. m sel amounts to m sel .). Otherwise, whenever sel is not used, but just a source file name (and no destiny is provided), the m command behaves much like the imv(1) shell command (from the renameutils package), providing an interactive renaming function: it prompts the user to enter a new name using the source file name as base, so that it does not need to be typed twice. For this alternative prompt, only TAB completion for file names is available.
r rm (for files) and rm -r (for directories)1 The user is prompted for confirmation whenever the list of files contains: 1. at least one directory, 2. three or more files, 3. at least one non-explicitly-expanded ELN (e.g.: r 12).
md mkdir -p

By default, the c, m, and r commands execute cp(1), mv(1), and rm(1) respectively in interactive mode to prompt the user before operations. Since this might sometimes be intrusive, it is possible to turn interactivity off in two different ways:

a) For the current command only: via the -f, --force switch. Example: c -f sel, m -f sel, or r -f *.

b) Permanently. Use the cpCmd, mvCmd, and rmForce options in the configuration file to permanently set any of these commands to non-interactive mode.

To use these commands without any of these arguments, or with any other argument you need, use the corresponding shell command. For instance, enter cp -arf sel instead of c sel. Of course, you can also write some aliases to use your preferred shell commands, for example, c='cp -avp'.

Clifm supports advcp, wcp, and rsync to copy files (they include a progress bar). To use them instead of cp set the corresponding option (cpCmd) in the configuration file. If advcp is selected, the command used is advcp -giRp (or advcp -gRp for non-interactive mode). If rsync is selected instead, the command used is rsync -avP. wcp takes no argument.
advmv is also supported to move files (to add a progress bar to mv). Use the mvCmd option in the configuration file to choose this alternative implementation of mv. In this case, the command used is advmv -gi (advmv -g for non-interactive mode).

1 If the TrashAsRm option is set to true in the configuration file (or the --trash-as-rm option was specified in the command line), r amounts to t to prevent accidental deletions. See the trash command.


colors

Print the list of currently used color codes (same as cs preview).


cd

Arguments: [ELN/DIR]

Change the current working directory to ELN/DIR.

Directories check order:

  1. If no argument, change to the home directory (HOME, or, if HOME is not set, the sixth field of the entry corresponding to the current user in /etc/passwd)
  2. If argument is an absolute path (begins with a slash character), or the first component is dot (.) or dot-dot (..), convert to canonical form (via realpath(3)) and, if a valid directory, change into it.
  3. Check CDPATH environment variable and append /DIR to each of the paths specified here. If the result of the concatenation is a valid directory, change into it.
  4. Check directories in the current working directory. If a matching directory is found, change to it.

You can use either ELN's or a string to indicate the directory you want. E.g.: cd 12 or cd ~/media. If autocd is enabled (default), cd 12 and cd ~/media could be written as 12 and ~/media respectively as well.

Unlike the shell cd(1) command, clifm's built-in cd function not only changes the current directory, but also lists its content (provided the option AutoLs is enabled, which is the default) according to a comprehensive list of color codes. By default, the output of cd is much like this shell command: cd DIR && ls \-\-color=auto \-\-group\-directories\-first.

Automatic files listing can be disabled either setting AutoLs to false in the configuration file or running clifm with the -o or --no-autols option.


cl, columns

Arguments: [on, off]

Toggle columns on/off.


cmd, commands

Show this list of commands. A more convenient way of getting information about clifm commands is via the interactive help plugin (depends on FZF), by default bound to the ihelp action name.


config

Arguments: [edit [APP]] [dump] [reset]

Use the edit subcommand to open/edit the main configuration file (F10 key is also available). If an application is specified (for example config edit vi), it will be used to open the file (otherwise, the default associated program is used). Note that, since edit is the default action, it can be omitted: run config to open the configuration file, or config vi to open it using vi.

Use the reset subcommand to generate a fresh configuration file and create a backup copy of the old one (named clifmrc.YYYYMMDD@HH:MM:SS).

The dump subcommand prints all setttings (as defined in the main configuration file) with their current values. If a current value differs from the default value, the entry is highlighted and the default value is displayed in brackets.

Note: edit (though deprecated) can be used as well instead of config.


cs, colorschemes

Arguments: [edit [APP]] [n, name] [p, preview] [NAME]

With no arguments, list available color schemes.

To print the current color scheme name use the name subcommand: cs name (or cs n).

To preview the current color scheme use the preview subcommand: cs preview (or cs p).

Use the edit subcommand to open/edit the configuration file of the current color scheme (open the file with APP if specified, or with the default associated application otherwise).

If NAME is specified (cs NAME), just switch to the color scheme named NAME. TAB completion is available for this function: cs <TAB>.


d, dup

Arguments: FILE ...

Duplicate the file FILE, where FILE could be either a directory or a regular file. The user will be asked for a destiny directory. The duplicated file names are generated by appending .copy to the basename of each source file. For example: d /my/file will copy /my/file into the directory selected by the user as file.copy. If file.copy already exists, an extra suffix will be added as follows: file.copy-N, where N is a positive integer (starting at 1).

If rsync(1) is found, it will be used as follows: rsync -aczvAXHS --progress. Else, cp(1) will be used: cp -a.


dh

Arguments: [QUERY] [PATH] [!ELN]

With no parameters, it prints the directory history list.1 To filter this list pass a query string: only entries matching this string will be displayed. In both cases, TAB completion is available. For example: dh down<TAB> will list only those entries matching "down" (fuzzily, if fuzzy-matching is enabled).

To access a specific entry, you can pass the entry number preceded by an exclamation mark. For example, if you want the entry number 12, enter dh !12 to change to the corresponding directory.

Finally, if an absolute path is passed as first parameter, dh works just as the cd command.

1 Take a look at the j command as well. Both commands deal with the list of visited directories, but in slightly different ways: while dh deals with the list of the last MaxDirhist entries (as defined in the configuration file, and including duplicates), the j command deals with the ranked list of visited directories (excluding duplicates).


ds, desel

Arguments: [*, a, all] [FILE ...]

Deselect one or more selected files.

If no parameter is provided, the user is prompted to either mark entries to be deselected or to edit the selections file via a text editor to manually deselect files.

Use *, a or all to the function to deselect all selected files at once. E.g.: ds *.

You can also pass the file name(s) (or ELN's) to be deselected as a parameter. For example: ds myfile 24.

TAB completion is available for this command.


exp

Arguments: [FILE ...]

With no argument, export the list of files in the current working directory to a temporary file. Otherwise, export only those specified as further arguments: they could be directories, file names, ELN's or some search expression like "*.c".


ext

Arguments: [on, off, status]

Toggle external commands on/off.


f, forth

Arguments: [h, hist] [clear] [!ELN]

The forth command works just like the back function, but it goes forward in the history record. Of course, you can use f hist, f h, fh, and f !ELN.


fc

Arguments: [on, off, status]

By default, clifm prints the amount of files contained by listed directories next to directory names. However, since this is an expensive feature, It might be desirable, for example, when listing files in a remote machine, to disable this feature. Use the off option to disable it. To permanently disable it, use the FilesCounter option in the configuration file.


ff, dirs-first

Arguments: [on, off, status]

Toggle list directories first on/off.


fs

Print an extract from 'What is Free Software?', written by Richard Stallman.


ft, filter

Arguments: [unset] [[!]REGEX,=FILE-TYPE-CHAR]

Filter the current list of files either by file name (using a regular expression) or file type (via specific file type characters).

With no argument, print the current filter. To remove the current filter use the unset option. To set a new filter enter ft followed by a query. For example:

Command Description
ft !^\. Exclude hidden files
ft !.*~$ Exclude backup files (ending with a tilde)
ft .*\.pdf$ List only .pdf files
ft ^D.* List only files starting with D

To filter by file type instead of file name use the = keyword followed by a file type character. Examples:

Command Description
ft !=d Exclude directories
ft =l List only symlinks
ft !=s Exclude socket files

The complete list of file type characters can be found here.

The filter will be lost at program exit. To permanently set a files filter use the Filter option (in the configuration file). You can also use the CLIFM_FILTER environment variable (see below).

For more information about filtering files consult the file filters section.


fz

Arguments: [on, off]

Toggle full directory size on/off (long view mode only)


hf, hh, hidden

Arguments: [on, off, status]

Toggle hidden files on/off.


history

Arguments: [edit] [clear] [-n] [on, off, status, show-time]

With no arguments, it shows the history list. If clear is passed as argument, it will delete all entries in the history file. Use edit to open the history file and modify it if needed. -n tells the history command to list only the last 'n' commands in the history list. Finally, you can temporarilly disable history (until you turn it on again) via history off.

To add timestamps, use the show-time subcommand. For example: history show-time, or history show-time -10 to list only the last ten entries.

You can use the exclamation mark (!) to perform some history commands:

Command Description
!<TAB> List history entries
!! Execute the last command
!n Execute the command number 'n' in the history list
!-n Execute the last - n command in the history list
!QUERY Execute the command starting with QUERY. TAB completion is available: !QUERY<TAB>

icons

Arguments: [on, off]

Toggle icons on/off


j, jc, jl, jp, je

Arguments:

Command Argument
j [--purge [NUM]] [--edit [APP]] [QUERY]...
jc [QUERY]...
jl [QUERY]...
jp [QUERY]...
je [APP] (short for j --edit)

j is the fastest way of using Kangaroo, a directory jumper function used to quickly navigate through the jump database (i.e. a database of visited directories).

Note: For a more detailed description of Kangaroo's internal workings see the Kangaroo frecency algorithm section.

Basic usage of the j command:

Command Example Description
j j List the entries in the jump database, printing 1) the order number of the corresponding entry, 2) the number of visits, 3) the days since the first visit, 4) the hours since the last visit, 5) the rank value, and 6) the directory name itself. An asterisk next to the rank value means that the corresponding directory is bookmarked, the current working directory in some workspace, or pinned
j STR j d Search for STR in the database and cd into the best ranked matching entry. j down will probably take you to /home/user/Downloads, provided this directory has been already visited and is the best ranked match in the database. Bear in mind that if STR is an actual directory, Kangaroo will just cd into it without performing any query
j STR STR j et mo Multiple query strings could be passed to the function. For instance, j et mo will first check for et in the jump database and then will further filter the search using the second parameter: mo. It will most probably take you (again, provided the directory has been already visited and is the best ranked match) to /etc/modprobe.d directory
j STR/ j src/ Search for an entry in the database whose last path segment contains STR. Let's suppose we have two entries matching src in the database: /media/src/images and /home/user/Downloads/clifm/src. If the first entry is better ranked than the second, j src will match this first entry. However, if what you really want is the second entry, appending a slash to the query string instructs Kangaroo to only match entries having src in the last path segment, here /home/user/Downloads/clifm/src
j STR\ j src\1 Search for an entry in the database whose first path segment contains STR

1 Both the slash and te backslash could be used together in one command. For example, j a\ b/ tells Kangaroo to search for an entry whose first path segment contains a and whose last segment contains b.

NOTE: Since it is not always obvious or easy to know where exactly a query string will take you, clifm will print, at the right of the cursor, the path matched by Kangaroo as you type. If the suggested path is the actually intended path, press Right or Ctrl-f to accept the suggestion. Otherwise, it will be ignored. You can also use TAB completion to print the list of matches for the current query string. For example: j - cTAB to list all entries in the directory history list containing a dash (-) and a c.

NOTE 2: To prevent directories from being added to the database, use the DirhistIgnore option in the main configuration file.

j accepts four modifiers:

Modifier Description
e Edit
p Parent
c Child
l List

Thus,

je will open the jump database to be edited if needed.

jp will do the same as jc but for parent directories.

jc will search for files querying only child directories relative to the current working directory.

Finally, jl prints the matches for the given query string(s), but without changing the current directory. Examples:

Command Description
je (same as j --edit) Open the jump database to be edited1
jp foo Jump to the best ranked parent directory matching foo
jc bar test Jump to the best ranked child directory matching both bar and test
jl foo Print all entries in the database matching the word "foo"

To shrink the database use the --purge option. Without parameters, non-existent (un-stat'able directories) are removed from the database. If a numeric parameter is passed, instead, all entries ranked below this number will be removed. For example, to remove all entries ranked below 100: j --purge 100.

1 je and j --edit can be used to manually edit the database file. This is useful, for example, to remove a specific directory from the database: remove the corresponding line, save, and quit the editor. Bear in mind that, if the directory is in the directory history (see the dh command), it won't be removed from the jump database.

Excluding and keeping directories

To prevent a directory from being added to the jump database (including the directory history), use the DirhistIgnore option in the main configuration file.

To mark a directory as permament (indefinitely keep it in the database), follow any of these procedures:

a. Bookmark it.
b. (since version 1.17) Edit the jump database (via either je or j --edit) and prepend a plus sign (+) to the corresponding entry. Example:

4690:1660605257:1707070662:/home/user
+1572:1660608801:1707073747:/home/user/git/cool_project
351:1660608842:1706764372:/home/user/Downloads

NOTE: An alternative way of navigating the jump database is using the jumper plugin (located in the plugins directory and bound by default to the ++ action name), which uses FZF to enable fuzzy searches. Enter ++ to perform a fuzzy search over the jump database.


k

If running in long view, toggle follow-symbolic-links on/off (Alt-+ is also available). To run clifm with this option enabled from the start, use the -L,--follow-symlinks-long command line switch.


kk

Toggle max-filename-len on/off (Ctrl-Alt-l is also available).


kb, keybinds

Arguments: [list] [bind FUNCTION] [edit [APP]] [conflict] [reset] [readline]

With no argument (of if the argument is list), this command prints the current key bindings and their associated functions.

This is the list of default key bindings. Use the bind subcommand to customize them to your liking.

Type kb bind <TAB> to get the list of available functions.

Enter kb bind FUNCTION to set FUNCTION to a new key binding. For example, kb bind previous-dir to set a new key binding for the previous-dir function. You'll see a little prompt: press the keys combination you want to associate to the specified function and then press Enter. While in this prompt, press Ctrl-d to abort or Ctrl-c to clear the line.

To manually edit the keybindings file, use the edit option (the file will be opened with APP, if specified, or with the default associated application otherwise).

If you somehow messed up your key bindings, you can check for key binding conflicts with the conflict subcommand, or use the reset subcommand to create a fresh keybindings file.

To see a list of the readline keybindings, use the readline option. For more information consult the readline page.


l, le

Create (l) and edit (le) symbolic links. Examples:

l file.zst link

This command creates a symbolic link to file.zst named link. If the link name is omitted (here link), the symbolic link is created as target_basename.link (in this example, file.zst.link) in the current directory.

By default, the link target is created literally (like ln -s would). The link creation mode can be set via the LinkCreationMode option in the configuration file. Available modes are: absolute, relative (like ln -rs would), and literal (default).

To edit a symbolic link target use the le command as follows:

le mylink

The user is prompted to enter a new link target using the current target as template.


ll, lv

Toggle long/detail view mode (Alt-l is also available)


lm

Arguments: [on, off]

Toggle the light mode on/off. This option, aimed to make files listing faster than the default mode, is especially useful for really old hardware or when working on remote machines. For more details see the light mode section.


log

Arguments: [cmd, msg [list, on, off, status, clear]]

Manage the program logs, either message or command logs.

Use on, off, and clear and status to enable, disable, clear logs, and query the current status of the log function, either for commands or for messages. For example: log cmd on, to enable command logs, or log msg status to query the status of the message logs.

If logs are enabled, they are written into the logs file (usually ~/.config/clifm/profiles/PROFILE/log.clifm). This file contains two kinds of logs: messages, and commands.

  1. Message logs are just a record of errors and warnings generated by clifm.

These logs have the following form:

m:[DATE] MSG

Enable these logs via the LogMsgs option in the configuration file, or the log msg on command.

  1. Command logs are just a record of commands entered in the command line. These logs have this form:
c:[DATE] CURRENT_DIRECTORY:CMD

Enable command logs using the CmdLogs option in the configuration file, or the log cmd on command.


media

NOTE: This command is Linux-specific

List available storage devices and mount/unmount the selected one using either udevil or udisks2 (at least one of these must be installed. udevil will be preferred over udisks2). If the device is unmounted, it will be automatically mounted, and if mounted, it will be automatically unmounted.

Though mountpoints are determined by the mounting application itself (udevil or udisks2), clifm will automatically cd into the corresponding mountpoint whenever the mount operation was successful.

When unmounting, and if the current directory is inside the mountpoint, clifm will attempt to cd into the previous visited directory, and, if none, into the home directory, before unmounting the device.

To get information about a device, enter and i followed by the ELN of the desired device. For example: i12.

NOTE: If you experience some issue mounting exFAT file systems when using udevil, consult https://github.com/IgnorantGuru/udevil/issues/89


mf

Arguments: [NUM, unset]

List only up to NUM files (valid range: >= 0). Use unset to remove the files limit (default). An indicator (listed_files/total_files) will be printed below the list of files whenever some file is excluded from the current list (e.g. 20/310). Note however that though some files are excluded, all of them are loaded anyway, so that you can still perform any valid operation on them. For example, even if only 10 files are listed, you can still search for ALL symbolic links in the corresponding directory using the appropriate command: /* -l.

If no argument is provided, mf just prints the current value.


mm, mime

Arguments: [open FILE] [info FILE] [edit [APP]] [import]

This is Lira, clifm's built-in resource opener.

Use the open subcommand to open FILE with the default associated application. Note that, since open is the default action, it can be omitted: mm FILE. This command is the same as open FILE (or o FILE in its abbreviated form), or just FILE (if auto-open is enabled).

The info subcommand prints MIME information about FILE: its MIME type and, if any, the application associated to this file name or its MIME type.

The edit subcommand allows you to edit and customize the MIME list file. For example, if a file has no default associated application, first get its MIME info (running mm info FILE), and then add a value for it to the MIME list file using the edit option (mm edit or F6). See the resource opener section for information about the mimelist file syntax.

Finally, via the import subcommand clifm will attempt to import MIME associations from the system (checking those paths specified by the Freedesktop specification). If at least one association is successfully imported, it will be stored as mimelist.clifm.XXXXXX, where XXXXXX is a random six characters alphanumerical string. Afterwards, you can add these new associations to your mimelist file using the mm edit command.


mp, mountpoints

List available mountpoints and change the current working directory to the selected mountpoint.


msg, messages

Arguments: [clear]

With no arguments, prints the list of messages in the current session. The clear option tells clifm to empty the messages list.


n, new

Arguments: [FILE, DIR/]...

Create new files and/or directories.

File names ending with a slash (/) will be created as directories, otherwise, as empty regular files. For example, let's create a regular file named myfile and a directory named my dir:

n myfile mydir/

Parent directories are created automatically if they do not exist. For instance, if you run n dir/file on an empty directory, the directory dir will be created before creating the regular file file.

If no file name is specified (same a Alt-n), the user will be prompted to enter one.

Safe file names

File name validation is performed over new names before creation. In case of an unsafe name, the user is warned and asked for confirmation.

A file name (namely, any component of a path) is considered unsafe if:

  1. Starts with a dash (-): command option flags collision
  2. Is a reserved keyword/expression (internal): fastback (...), ELN/range (12, 1-45), and MIME/file type expansion (@query, =x)
  3. Is a reserved system/shell keyword (~, ., ..)
  4. Contains embedded control characters (0x00-0x1f in the ASCII table)
  5. Contains embedded shell meta-characters (*?:[]\"<>|(){}&'!\;$)
  6. It is too long (larger than NAME_MAX, usually 255 bytes)

For more information about safe file names consult https://dwheeler.com/essays/fixing-unix-linux-filenames.html.


net

Arguments: [NAME] [list] [edit [APP]] [m, mount NAME] [u, unmount NAME]

1. The configuration file

The net command manages connections to remote file systems via a samba-like configuration file ($HOME/.config/clifm/profiles/PROFILE/nets.clifm). Here you can specify multiple remotes and options for each of these remotes.1 The syntax of this file is as follows:

Option Values Example Description
[NAME] [smb_work] A custom name for the remote
Comment A nice descriptive comment Comment=Work samba share Descriptive and short line describing the remote
Mountpoint /path/to/mountpoint Mounpoint=~/.config/clifm/mounts/smb_work The path where the remote will be mounted
MountCmd CMD MountCmd=sudo mount.cifs //111.111.111.111/share %m -o ...1 The complete command used to mount the remote
UnmountCmd CMD UnmountCmd=sudo umount %m1 2 The complete command used to unmount the remote
AutoMount Boolean AutoMount=true If true, mount this remote at startup
AutoUnmount Boolean AutoUnmount=false If true, unmount this remote at exit

1 %m is used as a placeholder for Mountpoint. %m will be replaced by the value of Mountpoint.
2 If running clifm as a normal, unprivileged user, you will probably need to run the mount and unmount commands as root.

1.a. Mounting remote file systems

In this case, just a few examples are enough:

a) A Samba share:

[samba_share]
Comment=My samba share
Mountpoint="~/.config/clifm/mounts/smb_share"
MountCmd=sudo mount.cifs //192.168.0.26/samba_share %m -o mapchars,credentials=/etc/samba/credentials/samba_share
UnmountCmd=sudo umount %m
AutoUnmount=false
AutoMount=false

b) A SSH file system (sshfs):

[ssh_share]
Comment=My ssh share
Mountpoint="/media/ssh"
MountCmd=sshfs user@192.168.0.26: %m -C -p 22
UnmountCmd=fusermount3 -u %m
AutoUnmount=true
AutoMount=false

1.b. Mounting local file systems

Though originally intended to manage remote file systems, net can also manage local file systems. Just provide the appropriate mount and unmount commands.

Since the device name assigned by the kernel might change accross reboots (specially when it comes to removable drives), it is recommended to mount using the device's UUID (Universal Unique Identifier) instead of its drive name. For example:

MountCmd=sudo mount -U c98d91g4-6781... %m

Here's an example of how to set up net to mount USB devices, one with a FAT file system, and another one with an ISO9660 file system:

[Sandisk USB]
Comment=Sandisk USB drive
Mountpoint="/media/usb"
MountCmd=sudo mount -o gid=1000,fmask=113,dmask=002 -U 5847-xxxx %m
UnmountCmd=sudo umount %m
AutoUnmount=false
AutoMount=false

[Kingston USB]
Comment=Kingston USB drive
Mountpoint="/media/usb2"
MountCmd=sudo mount -t iso9660 -U 2020-10-01-15-xx-yy-zz %m
UnmountCmd=sudo umount %m
AutoUnmount=false
AutoMount=false

NOTE: The gid, fmask, and dmask options are used to allow the user to access the mountpoint without elevated privileges.

If the device data is unknown, as it often happens when it comes to removable devices, you should use the media command instead.

2. The command syntax

Option Example Description
net (or net list) List the configuration for each remote available in the configuration file
edit net edit Edit the remotes configuration file. If no further argument is specified, the file will be opened with the current resource opener. However, you can pass an application as second parameter to open the configuration file. Example net edit nano
m, mount NAME net m smb_work If not already mounted, mount the remote named smb_work using the mount command and the mounpoint specified in the confifuration file, and automatically cd into the corresponding mountpoint. Since mount is the default action, it can be omitted: net smb_work
u, unmount NAME net u smb_work Unmount the remote named smb_work using the unmount command specified in the configuration file. TAB completion is available for this function too

NOTE: If you only need to copy some files to a remote location (including mobile phones) without the need to mount the resource, you can make use of the cprm.sh plugin, bound by default to the cr action. Set up your remotes (cr --edit) and then send the file you want (cr FILE). That's all.


o, open

Arguments: ELN/FILE [APPLICATION]

Open FILE, which can be either a directory, in which case it works just like the cd command, a regular file, or a symbolic link to either of the two. For example: o 12 (or just o12), o filename, o /path/to/filename.

By default, the open function will open files with the default application associated to them via Lira, the built-in resource opener (see the mime command). However, if you want to open a file with a different application, use the ow command, or add the application name as second parameter, e.g. o 12 leafpad.

If you want to run the program in the background, add the ampersand character, as usual: o 12 &, o 12&, o12&, or (if auto-open es enabled) just 12&.

If the file to be opened is an archive/compressed file, the archive function (see the ad command) will be executed instead.


oc

Arguments: ELN/FILE ...

Standing for ownership changer, oc allows you to interactively edit ownership of files passed as arguments.

A new prompt is displayed using the actual ownership of the file(s) to be edited as template. If editing multiple files with different ownership, only common ownership (both user and primary group) is set in the ownership template. Example:

oc 12
Edit file ownership (Ctrl-d to quit)
> root:root

Once in the prompt, supported values are: user, user:group, and :group (ID numbers are supported as well).

Examples:

Command Description
root or 0 Change user to root
:video or :981 Change primary group to video
peter:audio or 1000:986 or peter:986 or 1000:audio Change user to peter and primary group to audio

Recursion is not supported. Use chown(1) with the -R flag instead.

Use the pc command to edit files permissions.


opener

Arguments: [default] [APP]

With no argument, prints the currently used resource opener (by default, Lira, clifm's built-in opener). Otherwise, set APP as opener or, if default is passed instead, use Lira.


ow

Arguments: ELN/FILENAME [APP]

If no application is specified, print a list of available applications associated to ELN/FILENAME (either via its MIME type or file name), allowing the user to choose one of these applications, and then open the file with the selected application. In simple words, this is what in most GUI file managers is called Open with.... Available applications are taken from the MIME list file, and only actually installed applications are listed.

This command supports TAB completion: type ow filename <TAB> and those applications able to open FILENAME will be listed.


p, prop

Arguments: ELN/FILE ...

Print file properties for ELN/FILE. The output of this function is much like the combined output of ls -l and stat shell commands.

By default, directories size is not shown. Use pp instead of just p to print directories size as well (it could take longer depending on the directory's content).

Note that, unlike p, pp always follows symlinks. In case of symbolic links to directories, however, p prints information about the link target if FILE ends with a slash. Otherwise, information about the link itself is provided.

The P Time Style

The time style used by the p command to display file time information can be customized via the the --ptime-style command line switch, the PTimeStyle option in the configuration file, and the PTIME_STYLE environment variable (in this order of precedence).

Valid styles are: default, iso, long-iso, full-iso, full-iso-nano, and +FORMAT (FORMAT is interpreted like in strftime(3)). Nano-second precision is available via the %N modifier (like in date(1)). If unset, it defaults to +%Y-%m-%d %H:%M:%S.%N %z.


pc

Arguments: ELN/FILE ...

Standing for permissions changer, pc allows you to interactively edit file permissions of files passed as arguments (only traditional Unix permissions are supported).

A new prompt is displayed using the actual permissions (in symbolic notation) of the file(s) to be edited as template. If editing multiple files with different sets of permissions, only shared permission bits are set in the permissions template.

Bear in mind that, if editing multiple files at once, say pc sel or pc *.c, the new permission set will be applied to all of them.

Both symbolic and octal notation for the new permission set are allowed. Example:

pc 12
Edit file permissions (Ctrl-d to quit)
> rw-------

In this example, as seen in the permissions template, the file whose ELN is 12 has read/write permissions for the file owner, while none for group and others. To change these permissions edit the template. For instance, if we want to make the file executable by the owner of the file and the group:

> rwx--x---

or, using octal notation:

> 710

Recursion is not supported. Use chmod(1) with the -R flag instead.

If you just need to toggle the executable permission bit on a file, you can use the te command.

Use the oc command to edit files ownership.


pf, profile

Arguments: [list] [set, add, del PROFILE] [rename PROFILE NEW_NAME]

With no arguments, prints the name of the currently used profile. Use the list option to list available profiles. To switch, add, delete or rename a profile, use the set, add, del, and rename options respectively.

Bear in mind that, when switching profiles, command line arguments will be ignored.


pg, pager

Arguments: [on, off, once, status, NUM]

Toggle Mas, the built-in pager, on/off. Useful to list directories with hundreds or thousands of files, the pager will start working, if set to on, whenever one screen page is not enough to list all files.

Set it to any positive integer greater than 1 to run the pager only when the amount of files in the current directory is greater than or equal to this value, say 1000. 1 amounts to on and 0 to off.

Set to once to run the pager only once. Since this is the default parameter, pg (with no parameter) is equivalent to pg once. Alt-0 is also available.

While paging, the following keys are available:

?, h: Help Down arrow, Enter, Space: Advance one line Page down: Advance one page q: Stop paging (without printing remaining files) c: Stop paging (printing remaining files)

Note: To scroll lines up use whatever your terminal emulator has to offer (e.g.: mouse scrolling or some keybinding)

By default, the pager lists files using the current listing mode (long or short). Use PagerView in the configuration file (or --pager-view in the command line) to force the use of a specific mode. Possibles values:

auto: Use the current listing mode (default)
long: List files in long view
short: List files in short view

Note: An alternative pager is also available via the pager.sh plugin, bound by default to the gg action. To run it, enter gg.


pin

Arguments: [FILE/DIR]

Pin a file or a directory to be accessed later via the comma (,) keyword. For example, run pin mydir and then access mydir as follows: cd , where the comma is automatically expanded to the pinned file, in this case mydir. The comma keyword could be used with any command, either internal or external, e.g, ls ,.

With no arguments, the pin command prints the current pinned file, if any. If an argument is given, it will be taken as a file name to be pinned. Running this command again, frees the previous pinned files and sets a new one. In other words, only one pin is supported at a time.

An easy alternative to create as many pins or shortcuts as you want, and how you want, is to use the alias function. Bookmarks could also be used to achieve a very similar result.

At program exit, the pinned file is written to a file in the configuration directory (as .pin) to be loaded in the next session.


prompt

Arguments: [set NAME, list, edit [APP], reload, unset]

The prompt command is an easy means of temporarily changing the current prompt. Enter prompt or prompt list to list available prompts (taken from the prompts file: $HOME/.config/clifm/prompts.clifm).

To try a new prompt issue this command: prompt set cool_prompt. The current prompt will be changed to cool_prompt. Note that, since set is the default action, it can be omitted: prompt cool_prompt.

Use the edit parameter to edit prompts to your liking (opening the file with APP if specified, or with the default associated application otherwise). The current prompt will be automatically updated to reflect the changes.

You can permanently set your cool prompt in the color schemes file (via the cs edit command): set the Prompt line to whatever you like, either a prompt code or a prompt name (as defined in the prompts file). For example, Prompt="\x1b[0m\$ > " or Prompt="cool_prompt".

Consult the prompt section for more information.


q, quit, exit, Q

Gracefully quit clifm. Use Q to gracefully quit and enable the CD on quit functionality (write last visited directory to $XDG_CONFIG/clifm/.last to be later read by a shell function. See the CD on quit section).


rf, refresh

Refresh the screen, that is, reprint files in the current directory and update the prompt (Ctrl-l is also available). If the current directory is not accessible for any reason, rf will go up until it finds an accessible one, and then will change to that directory.


rl, reload

Reload all settings, except those passed as command line arguments, from the configuration file.


rr

Arguments: [DIR] [:EDITOR]

Remove files and/or directories in bulk using a text editor.

rr sends all files in DIR (or in the current directory if DIR is omitted) to a temporary file and opens it using EDITOR (or the default associated application for text/plain MIME type if EDITOR is omitted).

Once in the editor, remove the lines corresponding to the files you want to delete, save changes and close the editor. Removed file names will be listed and the user asked for confirmation to actually remove these files.

An alternative way of removing files in bulk is via the selection function: select a few files here and there, and then enter r sel.


s, sel

Arguments: ELN/FILE ... n [[!]PATTERN] [-filetype] [:PATH]

Consult the selecting files section.


sb, selbox

Show the elements currently contained in the Selection Box.


splash

Show the splash screen.


st, sort

Arguments: [METHOD] [rev]

With no argument, print the current sorting order. Else, set sorting order to METHOD, where METHOD is one of:

Number Reference
0 none
1 name
2 size
3 atime
4 btime
5 ctime
6 mtime
7 version
8 extension
9 inode
10 owner
11 group
12 blocks (since 1.17.11)
13 links (since 1.17.11)
14 type (since 1.20.1)

Both numbers and names are allowed. Example: st 2 or st size.

Methods 10 and 11 sort by owner and group ID names if using ID names in long-view (see the PropFields option in the configuration file). Otherwise, ID numbers are used.

By default, files are sorted from less to more (e.g.: from a to z - if sorting by name or version). Use the rev option to invert this order. E.g.: st rev or st atime rev. Switch back to the previous ordering running st rev again.

The Alt-z and Alt-x keybindings can be used to switch back and forth respectively between sorting orders.

NOTE: only none, name, version, extension, inode, and type are supported in light mode.

To permanently set the sorting order use the Sort option in the configuration file.


stats

Print statistics (such as amount of directories, executable files, SUID, SGID, other-writable files, etc) for files in the current directory.


t, trash

Arguments: [ELN/FILE ... n] [list] [clear, empty] [del [FILE ...]]

Move specified files to the trash can. E.g. t file1 file2.

With no argument (or by passing the list subcommand), it prints the list of currently trashed files. The clear (or empty) subcommand removes all files from the trash can, while the del subcommand lists trashed files allowing you to remove one or more of them (TAB completion is avaiable for the del parameters to list currently trashed files). To restore a trashed file, use the u command.

The trash directory is $XDG_DATA_HOME/Trash, falling back to $HOME/.local/share/Trash. To set an alternative trash directory, use the -T,--trash-dir command line option.

Since this trash system follows the Freedesktop specification, it is able to handle files trashed by different Trash implementations.

For a more detailed explanation see the Trashing files section.


tag

Arguments: [add, del, list, list-full, new, merge, rename, untag] [FILE]... [[:]TAG]

tag is the main Etiqueta command, clifm's built-in files tagging system. For a complete desciption of this command see the Tagging files section.


te

Arguments: FILE ...

Toggle executable bit (on user, group, and others) on FILE(s). It is equivalent to the -x and +x options for the shell chmod(1) command.


tips

Print the list of clifm tips


u, undel, untrash

Arguments: **[*, a, all] [FILE ...]

If file names are passed as parameters (usually via TAB completion), undelete these files, that is to say, restore them to their original location. Otherwise, this function prints a list of currently trashed files allowing the user to choose one or more of these files to be undeleted. You can also undelete all trashed files at once using the *, a or all parameter, for example: u *.


unpin

This command takes no argument. It just frees the current pin and, if it exists, deletes the .pin file generated by the pin command.


vv

Arguments: FILE... DIR

Copy FILE(s) into DIR and bulk rename then at once. Examples:

Copy all selected files into mydir and rename them:

vv sel mydir

Copy all PDF files into mydir and rename them:

vv *.pdf mydir

ver, version

Show clifm version details.


view

Arguments: [edit [APP]]

Preview files in the current directory in full screen. fzf(1) is required. Alt-- is also available.

To edit the previewer configuration file, enter view edit, or view edit vi to open it with a specific application, in this case vi(1).

Since version 1.8.1, this command allows files selection. Mark files with TAB and then press Enter or Right to confirm: marked files will be automatically sent to the Selection box.

The clifimg plugin can be used to make view display images as well.

For more information see the shotgun section.


ws

Arguments: [NUM/NAME, +, -]

Clifm offers up to eight workspaces, each with its own independent path.

With no argument, the ws command prints the list of workspaces (names, if defined) and its corresponding paths, highlighting the current workspace. Use NUM to switch to workspace NUM, NAME to swith to the workspace named NAME, the plus sign (+) to switch to the next workspace, and the minus sign (-) to switch to the previous workspace. Four keyboard shortcuts are available to easily switch to any of the first four workspaces: Alt-[1-4].

Every time an empty workspace is created, it starts in the path to the workspace from which it was invoked (in other words, in the current working directory).

Though workspaces are unnamed by default, you can name your workspaces wathever you like using the WorkspaceNames option in the configuration file.


x, X

Arguments: [DIR]

Open DIR, or the current working directory if DIR is not specified, in a new instance of clifm, as root if X (uppercase), as unprivileged user if x (lowercase). TerminalCmd (see the configuration file will be used to launch the new instance. If it is not set, xterm will be used as fallback terminal emulator.

This function is only available for graphical environments.


Keybindings

NOTE: Bear in mind that the following are the default keybindings, but may be freely modified by the user. Consult the keybindings customization page.

Keyboard shortcut Action Name 1
Ctrl-a, Home Move the cursor to the beginning of the line
Ctrl-e, End Move the cursor to the end of the line
Ctrl-Alt-j Switch to vi editing mode
Ctrl-Alt-e Switch back to emacs editing mode
Ctrl-f Move the cursor one character right, or accept the given suggestion if available
Ctrl-b Move the cursor one character left
Ctrl-k Delete line starting form current cursor position
Alt-c, Ctrl-u Delete the entire line clear-line
Alt-q Delete the last word2
Ctrl-y Copy the line buffer to the clipboard3
Up, Ctrl-p Move to the previous entry in the commands history
Down, Ctrl-n Move to the next entry in the commands history
Right, Ctrl-f Accept the entire suggestion
Alt-Right, Alt-f Accept the first suggested word only
Alt-n Create new file or directory create-file
Alt-g Toggle list-directories-first on/off dirs-first
Alt-, Toggle list only directories on/off only-dirs
Alt-l Toggle long view mode on/off toggle-long
Alt-i, Alt-. Toggle hidden files on/off toggle-hidden
Alt-+ Toggle follow-links on/off (long view only) toggle-follow-links-long
Ctrl-Alt-l Toggle max file name length on/off toggle-max-name-len
Ctrl-Alt-i, Alt-TAB Toggle disk usage analyzer mode on/off toggle-disk-usage
Alt-w Toggle full path file names in virtual directories toggle-virtualdir-full-paths
Ctrl-l Refresh the screen (reprint files in current directory and update prompt) refresh-screen
Alt-o Lock terminal lock
Alt-t Clear program messages clear-msgs
Alt-m List mountpoints mountpoints
Alt-b Launch the Bookmarks Manager bookmarks
Alt-h Show directory history show-dirhist
Alt-s Open the Selection Box selbox
Alt-- Preview files in the current directory (view command) launch-view
Alt-a Select all files in the current working directory select-all
Alt-d Deselect all selected files deselect-all
Alt-0 Run MAS, the files pager, on the current directory run-pager
Alt-p Change to pinned directory pinned-dir
Alt-1 Switch to workspace 1 workspace1
Alt-2 Switch to workspace 2 workspace2
Alt-3 Switch to workspace 3 workspace3
Alt-4 Switch to workspace 4 workspace4
Alt-r Change to root directory root-dir
Alt-e, Home Change to home directory home-dir
Alt-u, Shift-Up Change to parent directory parent-dir
Alt-j, Shift-Left Change to previous visited directory previous-dir
Alt-k, Shift-Right Change to next visited directory next-dir
Ctrl-Alt-o Switch to previous profile previous-profile
Ctrl-Alt-p Switch to next profile next-profile
Ctrl-Alt-a Archive selected files archive-sel
Ctrl-Alt-e Export selected files export-sel
Ctrl-Alt-r Rename selected files rename-sel
Ctrl-Alt-d Remove selected files remove-sel
Ctrl-Alt-t Trash selected files trash-sel
Ctrl-Alt-u Restore trashed files untrash-all
Ctrl-Alt-g Open/change-to last selected file/directory open-sel
Ctrl-Alt-n Move selected files into the current directory move-sel
Ctrl-Alt-v Copy selected files into the current directory copy-sel
Alt-y Toggle light mode on/off toggle-light
Alt-z Switch to previous sorting method sort-previous
Alt-x Switch to next sorting method sort-next
Ctrl-x Launch new instance of the program new-instance
Alt-v Prepend CLIFM_SUDO_CMD (if not set, defaults to sudo or doas) to the current command line prepend-sudo
F1 Go to the manpage show-manpage
F2 List commands show-cmds
F3 List keybindings show-kbinds
F6 Open the MIME list file open-mime
F7 Open the shotgun configuration file open-preview
F8 Open the current color scheme file edit-color-scheme
F9 Open the keybindings file open-keybinds
F10 Open the main configuration file open-config
F11 Open the bookmarks file open-bookmarks
F12 Quit quit
unset Open the jump database file open-jump-db
unset Display the commands history list (same as !<TAB>) cmd-hist

1 This column refers to the name of the function in the keybindings file. These names are used for keybindings customization. An empty value means that the keybinding for this particular function is not customizable
2 Besides space, the following characters are taken as word delimiters: /.-_=,:;@+*&$#<>%~|({[]})¿?¡!
3 Bound to the xclip.sh plugin.

Keybindings issues

Some of the above keybindings might not work on your console/terminal emulator, depending on the console/terminal, window manager and/or operating system settings. Some example cases and their workarounds:

1) Default keybindings will just not work:

  • Haiku terminal: Most of these keybindings won't work on the Haiku terminal, since Alt plays here the role Ctrl usually plays in most other systems (see the Haiku documentation). To fix this set your custom keybindings.

  • Kernel built-in console: Key sequences involving Shift (Shift-Up, Shift-Left, and Shift-Right in our case) will just not work. You can either bind the corresponding functions to another keybinding or use the alternative key sequences instead: Alt-u, Alt-j, and Alt-k respectively

2) Keybindings are not bound/recognized by the console/terminal emulator:

a) Tmux / Screen: If running clifm on Tmux/Screen, and Tmux/Screen is running on top of an Xterm, keybindings won't work. To fix this make sure to set the following resource in your .Xresources file and then restart Xterm:

echo "XTerm*metaSendsEscape: true" >> ~/.Xresources
xrdb merge ~/.Xresources

b) FreeBSD (sc), DragonFly (cons25), NetBSD (wsvt25), and OpenBSD (vt220) kernel consoles: Key sequences involving Alt won't work out of the box. Here's how to make it work:

  • On FreeBSD / DragonFly: You need to create a customized keymap based on your current keymap (here I use us as example). First, copy /usr/share/syscons/keymaps/us.iso.kbd to /usr/share/syscons/keymaps/us.clifm.kbd. Next, edit us.clifm.kbd and replace all instances of lalt with meta (if you want the Right Alt key as well, do the same for ralt). Next, remap the Alt key to the Windows key, whose scancode is, in my case, 105 (to find the scancode for a given key, you can use the misc/kbdscan port):
105   lalt   lalt   lalt   lalt   lalt   lalt   lalt   lalt    0

Finally, add this line to /etc/rc.conf:

keymap="us.clifm.kbd"

Note: For more information about this issue, consult this article from the EmacsWiki
Note 2: Clifm provides a copy of us.clifm.kbd. For other keymaps, you need to manually create the keymap file as described here.
Note 3: If you prefer not to go through all this hassle, you can use Esc instead of Alt, for example, Esc-. instead of Alt-. to toggle hidden files on-off.

  • On OpenBSD:
  1. Copy /etc/examples/wsconsctl.conf to /etc (if it does not already exist)
  2. Add the metaesc flag to your current keyboard enconding. For example keyboard.encoding=us.metaesc You might need to reboot the machine for changes to take effect.
  • On NetBSD: Add the metaesc flag to your current encoding in /etc/wscons.conf. Example: encoding us.metaesc You might need to reboot the machine for changes to take effect.

c) Konsole terminal emulator: If Shift-Left and Shift-Right are not already bound to any function, you need to bind them manually. Go to Settings -> Edit current profile -> Keyboard -> Default (Xfree4), and add these values:

Left+Shift	\E[1;2D
Right+Shift	\E[1;2C

If they are already bound, by contrast, you only need to unbound them (go to Settings -> Configure keyboard shortcuts, click on the corresponding keybinding, and set it to Custom (none)).

d) Mlterm: Alt keybindings key do not work by default. To fix this, copy /etc/mlterm/main to ~/.mlterm/main and set the following settings:

mod_meta_key = alt
mod_meta_mode = esc

3) Keybindings are already used by another application:

  • On some terminal emulators, some keybindings might be already bound to specific terminal functions, so that you only need to unbind them or rebind the corresponding functions to different key sequences.

  • Window managers: In case some of these keybindings are already used by your window manager, you only need to unbind the key or rebind the corresponding function to another key (either in your window manager on in clifm itself). Since each window manager uses its own mechanisms to set/unset keybindings, you should consult the appropriate manual.

Summarizing

Keybindings might not work for several reasons:

Cause Solution/workaround
The keybinding is hard-coded (or it isn't convenient to modify) in another application, either the operating system itself (Haiku case), or the terminal/console (kernel console case) Bind clifm's corresponding function to some other key/key-sequence or use some of the provided alternative key sequences
The keybinding is not bound/recognized by the console/terminal emulator itself Bound the keybinding from the console/terminal emulator settings
The keybinding is already taken by other application (Window Manager or console/terminal emulator) Rebind the corresponding key from the application or change clifm's keybinding for that function
Clone this wiki locally