* not interpreted in ftp, lftp

ftplftp

I'd been seeing that * isn't interpreted on ftp or lftp. Suppose I want to change a directory from current to say ./japan

In ftp> of lftp>, if I give:

$ cd jap*

it would show this error:

No such file or directory

So, I'm forced to give the complete name:

$ cd japan

EDIT #1

@thomas, @gold: Thank you for your valuable information. As * isn't interpreted with all commands (like cd), is there any way so that I can get away from typing every time the complete file name.

Best Answer

If you're using lftp you can use the Tab key to do path completion similar to the same method used when in a shell such as Bash or Zsh.

If you continue to hit Tab as you type it will complete as much of what matches. You can continue to type additional characters from the results of what's left that matches what you're typed thus far.

Example

Initially after connecting to an SFTP server.

lftp me@sftpserver:~> pwd
sftp://me@sftpserver/home/me

It I type cd u and then hit Tab one time it will complete this:

lftp me@sftpserver:~> cd upload/

If I hit it a 2nd time:

lftp me@sftpserver:~> cd upload/
2011-07-12/  a/

If I type a 2 and hit Tab another time it will complete like this:

lftp me@sftpserver:~> cd upload/2011-07-12/

At which point if you hit Enter it will run the above cd command.

Related Question