摘要
随着linux系统逐渐被广泛使用,系统使用者一般使用命令行的方式操作系统包括文件查找,特别是将linux系统作为服务器时,在数量众多的文件中找到需要的文件需要消耗很多时间,为了更快找到所需要的文件,针对现有的两种linux文件搜索命令的实现原理以及实现过程进行剖析,以及对著名的Boyer-Moore串匹配算法进行分析后,使用改进的BM算法对其中一种搜索命令即locate命令中字符串匹配算法进行优化,对改进算法的复杂度进行分析发现,在文件名的字符串匹配过程中与原来KMP算法相比较具有更高的效率,查找的速度更快。
Linux system has been widely used recently.Users often use command line to operate the system as well as find the files;especially,when the linux system is used as a server,one often spends much time in finding the file needed in a large number of files.In order to find the file needed quickly,we analyze the implementation principles and process of two existing linux file search commands;besides,after analyzing the famous Boyer Moore-string matching algorithm,we used the improved algorithm of BM to optimize the string matching algorithm in locate command,a kind of search command.Based on the analysis on complexity of the improved algorithm,it has higher efficiency and a faster query speed in the string matching process of filename,compared with the former KMP algorithm.
出处
《浙江理工大学学报(自然科学版)》
2016年第3期409-413,共5页
Journal of Zhejiang Sci-Tech University(Natural Sciences)
基金
国家自然科学基金项目(51475434)