Managing dotfiles with rcm

A hallmark feature of many GNU/Linux programs is the easy-to-edit configuration file. Nearly all common free software programs store configuration settings inside a plain text file, often in a structured format like JSON, YAML or “INI-like”. These configuration files are frequently found hidden inside a user’s home directory. However, a basic ls won’t reveal them. UNIX standards require that any file or directory name that begins with a period (or “dot”) is considered “hidden” and will not be listed in directory listings unless requested by the user. For example, to list all files using the ls program, pass the -a command-line option.

Over time, these configuration files become highly customized, and managing them becomes increasingly more challenging as time goes on. Not only that, but keeping them synchronized between multiple computers is a common challenge in large organizations. Finally, many users find a sense of pride in their unique configuration settings and want an easy way to share them with friends. That’s where rcm steps in.

rcm is a “rc” file management suite (“rc” is another convention for naming configuration files that has been adopted by some GNU/Linux programs like screen or bash). rcm provides a suite of commands to manage and list files it tracks. Install rcm using dnf.

Getting started

By default, rcm uses ~/.dotfiles for storing all the dotfiles it manages. A managed dotfile is actually stored inside ~/.dotfiles, and a symlink is placed in the expected file’s location. For example, if ~/.bashrc is tracked by rcm, a long listing would look like this.

[link@localhost ~]$ ls -l ~/.bashrc
lrwxrwxrwx. 1 link link 27 Dec 16 05:19 .bashrc -> /home/link/.dotfiles/bashrc
[link@localhost ~]$

rcm consists of 4 commands:

  • mkrc – convert a file into a dotfile managed by rcm
  • lsrc – list files managed by rcm
  • rcup – synchronize dotfiles managed by rcm
  • rcdn – remove all the symlinks managed by rcm

Share bashrc across two computers

It is not uncommon today for a user to have shell accounts on more than one computer. Keeping dotfiles synchronized between those computers can be a challenge. This scenario will present one possible solution, using only rcm and git.

First, convert (or “bless”) a file into a dotfile managed by rcm with mkrc.

[link@localhost ~]$ mkrc -v ~/.bashrc
'/home/link/.bashrc' -> '/home/link/.dotfiles/bashrc'
'/home/link/.dotfiles/bashrc' -> '/home/link/.bashrc'
[link@localhost ~]$

Next, verify the listings are correct with lsrc.

[link@localhost ~]$ lsrc
[link@localhost ~]$

Now create a git repository inside ~/.dotfiles and set up an accessible remote repository using your choice of hosted git repositories. Commit the bashrc file and push a new branch.

[link@localhost ~]$ cd ~/.dotfiles
[link@localhost .dotfiles]$ git init
Initialized empty Git repository in /home/link/.dotfiles/.git/
[link@localhost .dotfiles]$ git remote add origin
[link@localhost .dotfiles]$ git add bashrc
[link@localhost .dotfiles]$ git commit -m "initial commit"
[master (root-commit) b54406b] initial commit
1 file changed, 15 insertions(+)
create mode 100644 bashrc
[link@localhost .dotfiles]$ git push -u origin master
[link@localhost .dotfiles]$

On the second machine, clone this repository into ~/.dotfiles.

[link@remotehost ~]$ git clone ~/.dotfiles
[link@remotehost ~]$

Now update the symlinks managed by rcm with rcup.

[link@remotehost ~]$ rcup -v
replacing identical but unlinked /home/link/.bashrc
removed '/home/link/.bashrc'
'/home/link/.dotfiles/bashrc' -> '/home/link/.bashrc'
[link@remotehost ~]$

Overwrite the existing ~/.bashrc (if it exists) and restart the shell.

That’s it!  The host-specific option (-o) is a useful addition to the scenario above. And as always, be sure to read the manpages; they contain a wealth of example commands.

For Developers For System Administrators Using Software


  1. Leslie Satenstein

    Very nice write up.

    I have a desktop with multiple versions of Fedora (Gnome, KDE) and releases. I use a commen disk to store the configuration files. I go one step further and do likewise for /Documents, /Videos /Templates, /Music and other directories/ files I wish to share.
    Is RCM suitable for sharing other than for files?

    RCM is now on my Todo list. Thank you.

    • At its core, rcm is a symlink manager. It’s not a file synchronization tool. It does very well at managing symlinks, but it won’t synchronize those files to other computers. You need to use a separate synchronization tool (rsync, syncthing, etc.) to keep files across computers in sync.

      • gt

        my mc asm me about symlinks
        every time when i edit it. how turn off this functions?

  2. Sascha Peilicke

    The only drawback of this solution is that it isn’t self-hosting and depends on a distro package that might not be available everywhere. Instead I recommend using DFM ( It’s a single-file Perl script that works exactly the same as rcm but can be versioned right inside your dotfiles.git.

    Example project:

    I just clone that on any new machine and invoke dfm:

    $ git clone .dotfiles
    $ .dotfiles/bin/dfm install

    It’s trivial, self-hosting and works on macOS as well.

    • True. I have only used it on Fedora (in full disclosure, I am the Fedora package maintainer), but the upstream project repository has a number of distributions listed. It’s trivial to install and version using GNU stow too; it uses the GNU autotools.

    • You need to know some Perl though to dissect the script in case of issues.

      Personally I just use a bash script for this.

  3. Adolfina

    @Author:Thanks for the solution.

    BTW It also works nicely for directories …
    $ mkrc ~/.config/Clementine
    [me@tower .dotfiles]$ lsrc

  4. Is there any major difference to stow?

Comments are Closed

The opinions expressed on this website are those of each author, not of the author's employer or of Red Hat. Fedora Magazine aspires to publish all content under a Creative Commons license but may not be able to do so in all cases. You are responsible for ensuring that you have the necessary permission to reuse any work on this site. The Fedora logo is a trademark of Red Hat, Inc. Terms and Conditions