-1

I have a website that runs off an OpenWRT router. I'd like to optimize the site by removing an files that aren't being used. Here is my directory structure...

 /www/images
 /www/js
 /www/styles
 /www/otherSubDirectories  <--- not really named that

I'm mostly concerned about identifying images that are not used because those take the most space. But it would also be nice to identify style sheets and javascript files that are not being used. So, is there a way I can search /www and all sub directories and files and print a list of files in /www/images, /www/js, and /www/styles that are not referenced by any other files?

When I'm looking for files that contain a specific string I use this:

 find . | xargs grep -Hn 'myImage.jpg' 

That would tell me all files that reference the image. Maybe some variation of that?

Any help would be appreciated!

EV

4

2 回答 2

1

考虑使用交叉引用程序(例如lxr)来解决这个问题。(我还没有验证 lxr 是否可以完成这项工作,但相信它可以。)如果现成的交叉引用程序不起作用,请寻找一个你知道的语言的开源交叉引用程序,并适应它。

于 2012-09-25T17:19:52.240 回答
1

瑞士锉刀是非常好的工具。

通过模糊内容分析找出哪些文件被其他文件使用(引用)

于 2012-09-25T17:44:46.100 回答