• 0
Kerbital

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

Question

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?

Windows

  • 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.

Explanation:
- 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.

Mac

  • 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.

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

  • Like 3

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

I don't think this is the right sub forum for this post. Technical support is for asking questions about bugs/problems.

Share this post


Link to post
Share on other sites
  • 0
4 hours ago, Jas0n said:

I don't think this is the right sub forum for this post. Technical support is for asking questions about bugs/problems.

Where would you put it then?

Share this post


Link to post
Share on other sites
  • 0
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now