Clean up those wget .listing files

For some reason when I did a wget FTP mirror to backup some data it left behind lots of listing files, here is how you remove them.

Enter the directory and use the command:

$ for i in `find . -name ".listing"`; do rm -v $i; done

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Comments

Just a note, don’t use the dollar sign at the start, thats just to show its a shell (bash) prompt.

I had to do the same thing not long ago. Actually, it was recent enough that I was able to cat/grep my .bash_history to find the command I used. :)

Here’s what I ended up doing.

find . -type f -name “.listing” -exec rm -f {} \;

Same thing, different way, as always there are tons of ways.

-v in my method means Verbose which shows which .listing files were removed.

-f in your method means forceful, I don’t think this would be required though :)

Leave a comment

(required)

(required)