Printing multiple files from the right-click context menu in Nautilus

If you want print files without open them, you can use nautilus scripting.
You can use your printer or a pdf printer (sudo apt-get install cups-pdf)

Go to ~/.local/share/nautilus/scripts
Create a new file and call it ""

  1. #!/bin/bash
    # Print files from the right-click context menu in Nautilus.
    # Place this script in ~/.local/share/nautilus/scripts.
    # The printer to use (as shown in the Printer Configuration
    # gui or in /etc/cups/printers.conf).
    echo "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" | while read file
            lpr -P "$printer" "$file"
    exit 0
In printer value, you can choose your favorite one with the same name that you see in your printers.

Now give execution permission to the file (chmod +x and restart nautilus.
If you click on a document, now you can see it as follows (In my case I created 2 printers):


Popular posts from this blog

from: can't read /var/mail/ in Python scripts

How to fix Android when developer options are not available for this user

Fix "Set scan parameters failed: Input/output error" on Ubuntu 16.04