how to find file in linux

usually use "whereis" and "locate" and "find"

 

 

1.whereis [-bmsu] filename

-b:binary

-m:man page

-s:source file

-u:unusual

 

2.locate filename

will search in document database,not really search file system,so need usually update db

execute console:

sudo updatedb

 

not different big and small letter:

locate -i [filename]

 

3.find

more complited,more powerful

real-time search file

 

for example:

mikeli@dell-pc:~/code/algo_java$ find . -name BigMod.java
./src/BigMod.java


mikeli@dell-pc:~/code/algo_java$ find . -name "*Mod*.java"
./src/TestDivideMod.java
./src/BigMod.java
./nowcoder/TestDivideAndMod.java

 

 

 

reference: https://cn.linux-console.net/?p=20056

 https://zhuanlan.zhihu.com/p/637692181

 

posted @ 2022-11-06 18:55  MikeLi  阅读(20)  评论(0编辑  收藏  举报