I have a sftp server (Dbprd@101.102.130.23). I am trying to connect to it and search for files that contain .txt in (/files/base/incomming) path and get the count of lines in each file that contains (.txt). I was trying to achieve with the following command but it's throwing as invalid command:
echo "wc -l *.txt*"|sftp -q Dbprd@101.102.130.23:/files/base/incomming
o/p
sftp>
invalid command
Is there any way around to solve this?
sftp
doesn't fork a shell on the other end, so you can't use the usual binaries. But if you can usesftp
can you also usessh
? – nohillside Oct 27 '18 at 18:51