Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would love to, while on a given folder, right-click on it and choose play, to play all musics on that folder (and subfolder if any).

Is there an easy way to achieve this?

Thanks a lot

share|improve this question
VLC specific question ignoring non-music files:… – Ciro Santilli 巴拿馬文件 六四事件 法轮功 Nov 19 '14 at 14:53

You can achieve this with a Nautilus script.

First install the package ruby-1.9.1 install ruby-1.9.1.

Then copy this text into a text editor and save the file in ~/.gnome2/nautilus-scripts. Call it something like 'Play'.

#!/usr/bin/env ruby1.9.1
require 'find'

PLAYER = "banshee"
PLAYER_OPTIONS = ["--play-enqueued"]

def play *f
    IO.popen [PLAYER, *PLAYER_OPTIONS, *f] do |io|

def is_audio f
        io = IO.popen ['file', '--mime-type', f]
        op =' ')
        r = op[op.length-1] =~ /audio/

files = []

ARGV.each do |f|
    if f
        Find.find f do |f|
            files << f if is_audio(f)
        files << f if is_audio(f)


Open up ~/.gnome2/nautilus-scripts in the file manager, right click on the file, click properties and make it executable.

You can now right click on some files and select scripts -> Play to play all of the music files you have selected.

share|improve this answer
I've followed everything but, nothing happens when I select scripts -> Play :( It doesn't even open banshee. – MEM Apr 30 '11 at 9:54
This definitely works. Make sure you copied the whole of the text. It is very easy to miss of the last line when you select the text. You may find it easier to copy from – dv3500ea Apr 30 '11 at 13:57
Nope. I don't doubt the script work. But it not even starts the program, so even if I didn't add the last line (that I did), it should at least open it. I've remake the steps. No luck. Perhaps something to do with my own system configuration somehow. – MEM Apr 30 '11 at 15:52
I've called Play. No extension. Should I called it or something ? Or Play.rb ? – MEM Apr 30 '11 at 15:56
The extension makes no difference. As long as you have ruby-1.9.1 installed and the file is made executable, this should work. I don't really know what's going wrong. – dv3500ea Apr 30 '11 at 21:10
up vote 0 down vote accepted

Well, this end up working for me:

:) Yupi.

share|improve this answer
If the script provided by dv3500ea works on all (or almost all) ubuntu systems and not in mine, I will switch the answer for his post instead of this. However, this was, in fact the solution found. – MEM May 2 '11 at 19:05

This is probably silly answer but I just right clicked and selected "Open With Other Application... " then I selected my music player which is Audacious. Only drawback is that now every folder has an option to open with Audacious but I'm ok with that.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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