← home

gnome vfs command line tools

A long time ago I remember thinking it would be cool if you could use arbitrary URLs on the command line to refer to files, such as "cat http://google.com". I wrote something to do it (using wget I think), but for some reason I never got it to work right with LD_PRELOAD.

Well it turns out that gnome's vfs (virtual file system) has a set of command line tools to do things just like this. On ubuntu I installed the libgnomevfs2-bin package, and it gave me:

  • /usr/bin/gnomevfs-cat
  • /usr/bin/gnomevfs-copy
  • /usr/bin/gnomevfs-info
  • /usr/bin/gnomevfs-ls
  • /usr/bin/gnomevfs-monitor
  • /usr/bin/gnomevfs-mkdir
  • /usr/bin/gnomevfs-mv
  • /usr/bin/gnomevfs-rm
  • /usr/bin/gnomevfs-df

These tools generally work the same as cat, cp, ls, mv, rm, etc -- except that they can use arbitrary URLs as filenames. Such as:

gnomevfs-cp sftp://foo@bar.com:somefile.txt ftp://bob:blah@poop:/tmp/

This is pretty cool. The only thing that sucks is that they are pretty crude and take few or no options other than the filenames.

Also I found that if you use the sftp protocol, you need to use key auth. If password auth is needed, it just fails.


Nick Welch <nick@incise.org> · github