How do I perform directory listing but only display directories?
I tried ls | grep '/' but it got rejected with the error : usage: ls remote-directory local-file
This is because command line in FTP is different than your usual linux command line, but I was wondering if there is something equivalent in FTP command
Thanks in advance
The FTP protocol does not directly support such a feature. It does, however, allow for a broad interpretation that some servers use to accept things like using ls
-style arguments (e.g. LIST -d
, as mentioned by bdk).
Without such a broad interpretation by the server, you are left with retrieving this information from the listing. Unfortunately the standard doesn't provide a fixed format for this either (although it seems most servers use the ls -l
formatting).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With