6

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?

3
  • Forgive my ignorance, but why can't you glob?
    – djeikyb
    Commented Feb 15, 2011 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
    Commented Feb 16, 2011 at 16:19
  • Oh, sorry.. globbing is any sort of pattern matching. You said * wasn't working for you, which puzzles me.
    – djeikyb
    Commented Feb 16, 2011 at 19:16

1 Answer 1

3

Would this work?

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

Goodluck.

7
  • 1
    can you specify a samba folder to perform the find on?
    – Allan
    Commented Feb 15, 2011 at 21:37
  • 1
    @Allan you should be able to instead of the . use the samba folder location.
    – myusuf3
    Commented Feb 15, 2011 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
    Commented Feb 15, 2011 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
    Commented Feb 16, 2011 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
    Commented Feb 16, 2011 at 14:18

You must log in to answer this question.

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