smbclient -c with ls -l option

家住魔仙堡 提交于 2021-01-28 01:09:43

问题


i am trying to get folder lists from remote server, and it is not possible to mount remote server into my local computer (because of the permission issue).

i used

smbclient "//165.186.89.21/DeptDQ_141Q_FOTA" "--user=myid" -c 'ls;'

to get lists of the folder. and the result was success.

but, actually i want to use ls -l with the above the command line and when i try to get results using the line

smbclient "//165.186.89.21/DeptDQ_141Q_FOTA" "--user=LGE\final.lee" -c 'ls -l;'

it returns

NT_STATUS_NO_SUCH_FILE listing \-l

            64000 blocks of size 16777216. 6503 blocks available

... how should i use smbclient operator with ls -l option? please help me!


回答1:


smbclient ls does not run a native ls command, but rather invokes built-in functionality. As such, it does not support the usual options which a native, POSIX-compliant ls command would provide.

Thus, you cannot do this.

If your goal is to read metadata, consider trying the smbclient stat [filename] subcommand instead (if your server supports UNIX extensions), or smbclient allinfo [filename] (otherwise).



来源:https://stackoverflow.com/questions/25354920/smbclient-c-with-ls-l-option

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!