ls command in Remote Server

Unix Box: IBM AIX
Shell : K-Shell

When i logged into a remote server through FTP, and tried to find only required month file by typing `ls -ltr *200805`, the output is "ls remotefile localfile". I coudnt understand this.
What is want is get into the remote server and get the count of required files like "ls -ltr *200805 | wc -l". This is working in my machine but not on remote directory. how can i do this. Advance appreciations for the help

The ls command option in ftp is not the same as ls(1). It supports a very limited set of options. Read the ftp man page for more information.

Run the command via ssh:

ssh host "ls -ltr *200805 | wc -l" 

you might have to check mdtm utility in Net::FTP module.

But again, it will not work in ftp service hosted in windows machine

With OP's case I think its not possible, where access to specified directory is possible only through ftp login.

Had it been ssh login, there shouldn't be any problem at all.

"ssh host ls -ltr *200805* | wc -l"

When i type this, it says invalid command.
ssh is not working.
What is this ssh
and what should i put in place of host. (remote machine name or local machine name)

What about:

ssh host "ls -ltr *200805* | wc -l"

Secure Shell - Wikipedia, the free encyclopedia

remote host.