Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • seems not work! [user@host home]$ smbclient -W WORKGROUP --user='admin%admin$123' -c "lcd /data;recurse;mput directory" "//192.168.1.1/share" -bash: recurse: command not found -bash: mput: command not found Commented Aug 19, 2019 at 3:50
  • Any other idea? Commented Aug 20, 2019 at 12:28
  • The error message indicates the recurse and mput commands were somehow handled by the bash shell, not by the smbclient command. Did you accidentally omit a quote character at some point? Commented Aug 20, 2019 at 12:32
  • No, did you run your command successfully ? Commented Aug 20, 2019 at 13:18
  • 1
    Yes, I did. If your version of smbclient starts displaying prompts like Put directory directory?, you'll need to add prompt; to the -c command string before the mput, i.e. $ smbclient -W WORKGROUP --user='admin%admin$123' -c "lcd /data;recurse;prompt;mput directory" "//192.168.1.1/share". It is important that the argument to the -c option is quoted, as the semi-colon is a command separator for the shell. Your error message indicates the shell parsed everything up to the first semicolon as one command, recurse as another command etc. So you failed to quote the option argument. Commented Aug 20, 2019 at 14:32