9

Context: 16.04

How does one mouse right-click action to compute the MD5 sum of a file?

0

1 Answer 1

8

You can work with a nautilus script.

  1. Create the scripts directory if it does not yet exist

    mkdir -p ~/.local/share/nautilus/scripts/
    
  2. Place your script into that directory and make it executable (chmod +x <name_of_script> or via your file manager: right-click file, properties). Any executable script you put there will be available under an entry "Scripts" in your right-click menu.

    In your script, you can use the variable NAUTILUS_SCRIPT_SELECTED_FILE_PATHS to retrieve a newline-delimited list of selected files (i. e., one file path in case you selected a single file). You will also need to display the output: this can be done by piping the output of the command to zenity. This simple script will already cut it:

    #!/bin/bash
    set -eu -o pipefail
    md5sum "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" | zenity --text-info
    

Not the answer you're looking for? Browse other questions tagged .