TechSpot

How do i create i text file of folder contents?

By lowlifelenny
Aug 11, 2002
  1. I do not know how to do this. Please help. Thanks in advance
     
  2. Didou

    Didou Bowtie extraordinair! Posts: 4,274

    That's a very clear question. We do not know if you're using Windows, DOS, Unix, Linux, BeOS, etc...

    For Windows, at the console type :

    dir C:\temp > contents.txt

    This will create a file called contents.txt with a listing of files on C:\temp ( for more options, type dir /? ).

    dir C:\temp >> contents.txt

    This is almost the same thing as the first instruction, only difference is that if Contents.txt allready exists, its content won't be overwritten by the new one. The new listinbg will be put at the end of what was allready present in the TXT file.

    For Linux, once again at the console type :

    ls /temp > contents.txt

    This will create a file called contents.txt with a listing of files on /temp ( for more options, type ls --help ).
     
  3. Phantasm66

    Phantasm66 TS Rookie Posts: 5,734   +6

    Well done Didou, that's an excellent answer.
     
  4. lowlifelenny

    lowlifelenny TS Rookie Topic Starter

    Cheers mate. That was a big help. Thanks again
     
Topic Status:
Not open for further replies.

Similar Topics

Add New Comment

You need to be a member to leave a comment. Join thousands of tech enthusiasts and participate.
TechSpot Account You may also...