[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

How to use wildcards in remote directory with sftp



This does what I want, opening the remote directory:

$ sftp dell03:junk
Connected to dell03.
Changing to: /Users/cdr/junk

With wildcards it doesn't work; the remote directory is not recognized as a directory:

$ sftp dell03:"ju*"
Connected to dell03.
Fetching /Users/cdr/junk/ to junk
Cannot download non-regular file: /Users/cdr/junk/

I've tried various quoting methods, and tried terminating the directory name with /, but nothing worked.

So I connect without wildcards. Then I can use a wildcard here
sftp> ls ju*
junk/backhd_asus10        junk/deb7xfce20140704     junk/to_bigdrive

but not here
sftp> cd ju*
Couldn't canonicalize: No such file or directory

The only workaround I've found to avoid typing a long pathname in full is to save it in an environment variable. Is there a better way?



Reply to: