Can I remove .listing files from web subdirectories?

5

I was working on my webserver, and noticed I wasn't able to remove a directory as it wasn't empty. I ran ls in it, and found a single .listing file. Opening it, I found a list of the files that were once in the directory, which was now out of date. The file suggested that the now-deleted files belonged to the ftp user. This leads me to believe the listing file was copied from my old shared web host, as the current server is not running an FTP server (although SSH/SFTP is). I looked around further, and found that almost all web-facing directories have a .listing file in them.

Having looked on the web, it seems they are created by an FTP server, but I can't find much more information than that. I found that wget supports an argument which prevents wget from not downloading them, but I didn't find anything saying whether they could be removed. My guess it that they can.

Can I safely remove the .listing files littered throughout my website directories?

Blieque

Posted 2015-02-04T23:22:50.683

Reputation: 231

Answers

2

gnu.org contains this information (and more) in the wget FTP Options manual in the description for the --no-remove-listing option:

Normally, these files contain the raw directory listings received from FTP servers. Not removing them can be useful for debugging purposes, or when you want to be able to easily check on the contents of remote server directories (e.g. to verify that a mirror you’re running is complete).

jlbang

Posted 2015-02-04T23:22:50.683

Reputation: 121