I have a script that "generates" a sequentially named image (e.g. img_001.jpg) and saves it in a fixed directory, e.g. ~/Documents/Images.

After the file has been created, I'd like to display the folder with the file selected, i.e. similar to how Chrome and Firefox will open the directory of a downloaded file with it already selected.

Apparently my Linux Mint edition uses Caja. I tried,

caja $filename

But Caja decides to actually open the file using the default application. The caja help isn't very useful and I've looked everywhere but can't find any similar questions. Hopefully I'm just using the wrong search terms and Caja does actually support something as basic as this?

  • What's your MIME of $file? pdf? Do you want to generate *.jpg with caja $file? – PersianGulf Sep 21 '14 at 11:13

This command work fine for me:

dbus-send --session --type=method_call    --dest="org.freedesktop.FileManager1"     "/org/freedesktop/FileManager1"     "org.freedesktop.FileManager1.ShowItems" array:string:"file:///etc/hosts"     string:""

I'm not sure about selecting the file, but you're telling caja to open file $filename, when what you really want to do is to open the directory that contains $filename.

So instead do this:

$ caja ~/Documents/Images

However as I stated, this will not select a particular file. That capability does not appear to be present in Caja.

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.