Category
GNU/Linux
Published
Reading time
3 minutes
Discussion
No comments yet

GNU/Linux

Text-to-Clipboard for the Nautilus/Files File Manager

The Copy File Contents extension copies the contents of a text file straight from the Nautilus file manager to the clipboard, no detour through an editor needed.

The file manager of the GNOME desktop environment, formerly known as Nautilus and now called “Files” (“Dateien” in German), isn’t exactly famous for its huge feature set. Some useful features, like opening a terminal window in the current folder, can be added with extensions. An alternative to the well-known nautilus-open-terminal extension is the newer nautilus-open-any-terminal, which lets you configure almost any Linux terminal.

The extension Copy File Contents was just released. It lets you copy the contents of a file straight from the file manager to the system clipboard, without first having to open the file in an editor or in preview mode (via the space bar). Especially for users who work with text files regularly, this extension is a real relief.

Requirements

Before you can install the extension, make sure the nautilus-python package is present on your system. It is available in the repositories of most common distributions. Depending on the distribution you use, the installation looks like this:

Terminal3 lines
<strong>sudo apt install nautilus-python</strong>   # Ubuntu, Debian und Co.
<strong>sudo dnf install nautilus-python</strong>   # Fedora
<strong>sudo pacman -S python-nautilus</strong>     # Arch Linux und Co.

Installing the extension

The extension itself isn’t in the repositories yet, but you can easily install it with a Makefile or manually. First, clone the repository and change into the directory:

Terminal2 lines
<strong>git clone https://github.com/EuCaue/nautilus-extension-copy-file-contents.git</strong>
<strong>cd nautilus-extension-copy-file-contents</strong>
Installing with the Makefile

Use the following command to install the extension:

Terminal
<strong>make install</strong>

This installs the extension to ~/.local in your home directory, so you don’t need administrative privileges.

Manual installation

Alternatively, you can install the extension manually. Simply copy the Python script into the Nautilus extensions folder:

Terminal2 lines
<strong>mkdir -p ~/.local/share/nautilus-python/extensions/</strong>
<strong>cp ./src/nautilus_copy_file_contents.py ~/.local/share/nautilus-python/extensions/</strong>

After the installation, you generally need to restart Nautilus. You can do that with the following command in the terminal. There is no “real” entry in the file manager’s menus.

Terminal
<strong>nautilus -q</strong>

Uninstalling the extension

If you want to uninstall the extension, you again have two options:

Uninstalling with the Makefile
Terminal
<strong>make uninstall</strong>
Manual uninstallation

Change into the Nautilus extensions directory and delete the file:

Terminal2 lines
<strong>cd ~/.local/share/nautilus-python/extensions/</strong>
<strong>rm nautilus_copy_file_contents.py</strong>

Development and debugging

If you want to modify the extension or debug it, you can enable debug mode by setting an environment variable in the terminal. To update, just repeat the installation:

Terminal3 lines
<strong>export NAUTILUS_PYTHON_DEBUG=misc</strong>
<strong>make install && nautilus -q</strong>
<strong>nautilus</strong>

Now the extension is ready and helps you copy the contents of files quickly and easily.

Discussion No comments yet – be the first.

Write a comment

Comments

Leave a Reply

Your email address will not be published.

Markdown is supported: **bold**, _italic_, [link text](URL), `Code`, lines starting with - for lists, 1. for numbered lists, triple backticks for code blocks.

Security check: runs automatically, nothing for you to do.

Lines are wider than the screen. Turn your phone sideways to see more – or switch on Wrap.

Linux und Ich — Text-to-Clipboard for the Nautilus/Files File Manager
https://linuxundich.de/en/text-to-clipboard-for-the-nautilus-files-file-manager/ — printed on October 21, 2026