使用 fd-find 代替 find,效率更好
下载方式 :
sudo apt-get install fd-find
test@test:~$ sudo apt-get install fd-find
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
fd-find
0 upgraded, 1 newly installed, 0 to remove and 60 not upgraded.
Need to get 721 kB of archives.
After this operation, 2,462 kB of additional disk space will be used.
Get:1 http://hk.archive.ubuntu.com/ubuntu focal/universe amd64 fd-find amd64 7.4.0-2build1 [721 kB]
Fetched 721 kB in 2s (342 kB/s)
Selecting previously unselected package fd-find.
(Reading database ... 133991 files and directories currently installed.)
Preparing to unpack .../fd-find_7.4.0-2build1_amd64.deb ...
Unpacking fd-find (7.4.0-2build1) ...
Setting up fd-find (7.4.0-2build1) ...
Processing triggers for man-db (2.9.1-1) ...
避免命令名称冲突情况,使用 alias
alias 替代名称=原命令名称
帮助
test@test:/$ fdfind -h
fd 7.4.0
USAGE:
fd [FLAGS/OPTIONS] [<pattern>] [<path>...]
FLAGS:
-H, --hidden Search hidden files and directories
-I, --no-ignore Do not respect .(git|fd)ignore files
--no-ignore-vcs Do not respect .gitignore files
-s, --case-sensitive Case-sensitive search (default: smart case)
-i, --ignore-case Case-insensitive search (default: smart case)
-g, --glob Glob-based search (default: regular expression)
-F, --fixed-strings Treat the pattern as a literal string
-a, --absolute-path Show absolute instead of relative paths
-L, --follow Follow symbolic links
-p, --full-path Search full path (default: file-/dirname only)
-0, --print0 Separate results by the null character
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-d, --max-depth <depth> Set maximum search depth (default: none)
-t, --type <filetype>... Filter by type: file (f), directory (d), symlink (l),
executable (x), empty (e)
-e, --extension <ext>... Filter by file extension
-x, --exec <cmd> Execute a command for each search result
-X, --exec-batch <cmd> Execute a command with all search results at once
-E, --exclude <pattern>... Exclude entries that match the given glob pattern
-c, --color <when> When to use colors: never, *auto*, always
-S, --size <size>... Limit results based on the size of files.
--changed-within <date|dur> Filter by file modification time (newer than)
--changed-before <date|dur> Filter by file modification time (older than)
ARGS:
<pattern> the search pattern: a regular expression unless '--glob' is used (optional)
<path>... the root directory for the filesystem search (optional)
Note: `fd -h` prints a short and concise overview while `fd --help` gives all details.
找寻 java 档案
test@test:/$ fdfind -e java
home/test/Demo.java
查找 password 名称档案,有高亮效果
test@test:/$ fdfind 'password'
查找 path 类型档案,名称包含 password
fdfind -e path 'password'
预设不区分大小写,可以加-tf
区分大写,注意小写不行喔!!
test@test:~$ touch Demo
test@test:~$ touch demo
test@test:~$ ls
demo Demo
test@test:~$ fdfind demo
Demo
demo
test@test:~$ fdfind -tf demo
Demo
demo
test@test:~$ fdfind -tf Demo
Demo
找寻後执行命令,像是找寻後删除
test@test:~$ fdfind -tf Demo -x rm {}
test@test:~$ ls
demo
最近发现一个酷酷的东西叫GooseMod 他能方便管理Discord的MOD 安装步骤 先到Goos...
Logs - 挖掘系统内部发生的状况 系列文章 (1/4) - Logs 与 Filebeat 的基...
在了解了独立表格空间的基本结构後,系统表格空间就好了解多了,基本上很类似,但系统表格空间需要纪录一些...
简介 editText有些常用设定,有时候会不小心忽略掉。虽然有些不是必备,但使用者体验的优化还是很...
一、主题内容 虽然知道全端工程师的路不好走,自己目前也还不是很称职,仍想以自己转职的角度、回顾的方式...