Jump to content

How to create a text listing of a folder's contents and save it as text

Recommended Posts

This is very handy, so you can copy and  paste in the content of your GameData folder quickly, rather than creating a screenshot. Just keep in mind, that this may not show all mods, as some mods just create cfg files inside other folders as is the case with scatterer and EVE configs, or texture replacers for instance. Also, some mods have patches that change how other mods behave, SSTU is a good example but there are others.

If you have CKAN installed then simply go to File menu->Export installed mods... This creates a KSP CKAN Mods Export.ckan file which really is just a text file like the game config files.

Otherwise... Few notes:

This will create a simple text file containing the listing of the directory. You will be able to open it and just copy and paste the list into a forum post.
In both cases, Mac and Windows hidden system files are not shown, but we don't need them for this.
Both files and folders are included in the list.
The list will be alphabetical and will ignore the Windows "folders first" directory listing convention, so that may throw off Windows users.
There may be other ways of doing this.

How to create a text listing of a folder's content and save it as text so it can be pasted or emailed?


  • Go to the directory you want to list. For example, GameData to list all your mods.
  • While holding the SHIFT key right-click inside the directory.
  • Select "Open Command Window Here".
  • In the command window type the following and hit ENTER: dir /b >directory.txt
  • There is a space between "dir" and "/b" then space after "/b" again.
  • This will create a text file called directory.txt in the same directory.

- dir lists the content of a directory
- /b makes the output bare, i.e. without all the dates, sizes and permissions as we only want the file ad folder names.


  • Open the Terminal
  • If you know how to, then change to the directory you want to list.
  • Otherwise, find and open the Terminal.app
  • Start typing cd then hit space then drag and drop the directory to the terminal window and hit Return.
  • (example if I was listing my Dropbox folder I would drag and drop the Dropbox folder and see this: cd /Volumes/Storage/Kerbital/Dropbox).
  • Do not miss the space after cd!
  • Now type in the Terminal ls > ~/Desktop/directory.txt. Again, pay attention to spaces, there is a space after ls and after >
  • This will create a text file called directory.txt on your desktop.

- ls lists the content of a directory like dir does on Windows
- as opposed to Windows, ls output is bare by default.

Link to comment
Share on other sites

On 4/5/2017 at 11:11 AM, Kerbital said:

Where would you put it then?

well, I think you should ask moderator to sticky it, because its a helpful post, but if not stickied it would just be buried in all the questions.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...