1. 程式人生 > >Linux命令——locate、find、whereis、which、type

Linux命令——locate、find、whereis、which、type

有時候你想要查詢一個檔案 ,不可能挨個目錄進去看。Linux提供了幾個命令用於查詢

locate

和這個一脈的好像還有slocate,rlocate,沒仔細研究過有啥區別。

locate可以說是查詢效率最高的一款根據,但是有個小缺點,這個小缺點也是他為啥查詢效率高的原因。locate的查詢方式不是根據檔案inode查詢檔案系統,而是直接查詢資料庫。每天(cron.daily) locate執行程式updatedb,將所有檔案資訊儲存到資料庫。

http://www.ruanyifeng.com/blog/2009/10/5_ways_to_search_for_files_using_the_terminal.html

https://www.howtoforge.com/linux-locate-command/

https://www.computerhope.com/unix/uwhereis.htm

http://cn.linux.vbird.org/linux_basic/0320bash.php

https://www.tecmint.com/linux-locate-command-practical-examples/

https://www.cnblogs.com/xqzt/p/5426666.html