How to list a directory in Linux from windows

I am trying to list all the files and directories under /opt/ in Linux. My code runs in windows platform. What i have done is reading a config file which consists of all the login credentials of the Linux system but i am not able to list the files or directories even though my windows machine connects to the Linux server.

import ConfigParser
config = ConfigParser.RawConfigParser()'config.cfg')
USER = config.get('DB_Connector','db.user_name' )
PASSWORD = config.get('DB_Connector','db.password' )
IP = config.get('DB_Connector','db.IP')

I wrote a code which will list all the files and directories but that has to be run in Linux only.

import os
lst = os.listdir('/opt')

But my requirement is to run the code from windows and get the list. Can someone help me in this?

Source: python

Leave a Reply