I need to find out huge files in the Linux server and where many people would be processing huge files and data loading will be happening. "find" command takes more time to give the output. Is there any other way to speed up the result of my command other than simplifying my search path?
3 Answers
You can use dnotify
. You did not specify exactly what you want to do, so I cannot be more specific, but I will remark that the dnotify Man page states:
dnotify - Execute a command when the contents of a directory change
For instance, this command
dnotify -CD -r /home/my_name -e echo change to {}
will print "change to " and then the name of the file changed, every time a file is created or deleted inside /home/my_name or any of its subdirectories.
You can couple this with a previously created list of existing files to keep a fully up-to-date list of files, to be read instead of running find.
Use Apache Lucene 4.6.0 or ownCloud Server 5.
Apache Solr 4.6.0 for personal data fast-fulltext search.
Microsoft Windows freeware platform alternative: SharePoint 2013 Foundation.
1) man locate.
2) If you have relatively few, or not really important changes: make a cache from your directory hierarchy with a find -type f intoa file. Once. Later you can grep in this file, which is much faster.
-
1) My version of locate does not allow to filter result depending on size. 2) That means adding a crontab like
echo "0 0 * * * root find / -size +XXXXXX ... >/var/tmp/bigfiles.txt" > /etc/cron.d/find_bigfiles
– mverooneDec 2, 2013 at 9:47 -