Directory listing script?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • snowball179
    Confirmed User
    • Dec 2002
    • 261

    #1

    Directory listing script?

    I need a script that will scan on a webserver for all the sub-directories on a given directory, and will write itMs path in a *.txt file.

    Does anyone knows any?
  • snowball179
    Confirmed User
    • Dec 2002
    • 261

    #2
    anyone knows any?

    Comment

    • FuqALot
      Confirmed User
      • Dec 2001
      • 3817

      #3
      Here you go.

      #!/usr/bin/perl
      @dir = (`du`);
      open (list,">list.txt");
      foreach (@dir) { print list; }
      close(list);

      put in a file and drop it in your starting directory
      launch with: perl file, through ssh or whatever :-P.

      Comment

      • snowball179
        Confirmed User
        • Dec 2002
        • 261

        #4
        I need to put this perl file in a *.pl or *.chgi file, in the category I want it to list....with a *.txt file that I chmod to 777, right?

        The problem is that I cannot put perl files outside the cgi-bin directory...

        Comment

        • FuqALot
          Confirmed User
          • Dec 2001
          • 3817

          #5
          If you run this through ssh or telnet then it doesn't matter wether you name it .pl .cgi. or whatever, you should just put it in a file and then put the file in a starting directory, and make sure the script can create a file in that starting directory, and then type: 'perl file.pl', without the quotes, list.txt will then be created with the directories and stuff.

          Comment

          • snowball179
            Confirmed User
            • Dec 2002
            • 261

            #6
            can I load it with IE?
            I cannot connect to that server with ssh right now, and my tech is not here.

            Comment

            Working...