FTP for a list of directories only. Impossible?

How to execute a list of directories but only display directories?

I tried ls | grep '/' , but it was rejected with an error :: local local directory file ls

This is because the FTP command line is different from the regular linux command line, but I was wondering if there was anything in the FTP command

Thanks in advance

+5
source share
2 answers

FTP does not directly support this feature. However, this allows a wide interpretation, which some servers use to accept things such as using the ls-style arguments (for example LIST -d, as stated in bdk).

. , ( , ls -l).

+6

ftp, , , .

 ftp -i myhost.com/yolo/ <<< "ls -1R all_files_list.txt"

, , ​​ "-rwxrwxrw". , , 'd'

grep '^d' all_files_list.txt > only_directories_list.txt
0

All Articles