I want to execute this custom command on a file from the Gnome File Browser:

hexdump -C $f > $f.dump

That would create a hexdump of the file with the file's name + .dump in the directory that the file exists in. When I say $f above I mean something that would substitute the name of the file that was opened.

So I've tried "Open with", "Use a custom command". I can't get it to work. I've tried a number of symbols in place of $f. Is it even possible?

Before you suggest getting a GUI hexdump program, this is just one example. I have the need to do this sort of thing for many terminal-type programs.

Am I the only person on Earth who wishes for a hybrid File-Browser-slash-Command-Terminal? That would be a file browser which contained a terminal pane who's current directory always matched that of the file browser. One could execute shell commands in the context of what they were viewing in the browser.


I'd just write a skript that does what you want and open the file with it.

In your case this should do:

hexdump -C "$1" > "$1.dump"

make it executable and you should be good to go.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.