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 am using this command

gvfs-move file smb://server/directory/file

to move files over a samba share I would like to transfer multiple files by piping the results of a gvfs-ls to the same command however I cannot use a wild card to limit the search like this

gvfs-ls smb://server/directory/*.mkv

How do I create a list of files over a samba share and proccess those?

share|improve this question
Forgive my ignorance, but why can't you glob? – djeikyb Feb 15 '11 at 21:33
@djeikyb when I am a good enough python programmer to know about glob I would probably do the whole thing in python but thanks for the comment. Interestingly I found it fairly difficult to find anything on file management in python but I am probably searching for the wrong thing – Allan Feb 16 '11 at 16:19
Oh, sorry.. globbing is any sort of pattern matching. You said * wasn't working for you, which puzzles me. – djeikyb Feb 16 '11 at 19:16
up vote 2 down vote accepted

Would this work?

find . -iname *.mkv | xargs 'command'


share|improve this answer
can you specify a samba folder to perform the find on? – Allan Feb 15 '11 at 21:37
@Allan you should be able to instead of the . use the samba folder location. – myusuf3 Feb 15 '11 at 21:48
to find on a smb folder not mounted by fstab I had to write it like this find ~/.gvfs/"videos on media-centre" -iname *.mkv I'll check out if the whole command works tomorrow dusty and give you an update. – Allan Feb 15 '11 at 23:55
the problem I'm having is a spaces problem because find needs the .gvfs/ folder name to search on which always has spaces in which get passed through to gvfs-move which cries :( – Allan Feb 16 '11 at 11:07
@Allan what you can do is to enter the the directory you want to copy from and run the command above I have listed. if you need a path with spaces "pathhere" that should solve that issue. – myusuf3 Feb 16 '11 at 14:18

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.