I am Using Pyhton paramiko and My website server has folder structure like this-
1]dir1
--dirP
--dirQ
2]dir2
--dirA
--file.sh
--dirB
3]dir3
where i want to access file.sh from dirA inside dir2 folder
I tried this-
import paramiko
client.connect('mysite.com', username='something', password='something')
stdin, stdout, stderr = client.exec_command('cd dir2')
stdin, stdout, stderr = client.exec_command('ls')
for line in stdout:
print('... ' + line.strip('\n'))
but i get output-
...dir1
...dir2
...dir3
expected output is-
...dirA
...dirB
and also suggest how can i execute file.sh too?