Crates.io | fdn |
lib.rs | fdn |
version | 0.8.5 |
source | src |
created_at | 2024-01-19 13:22:31.715094 |
updated_at | 2024-07-11 14:57:36.606081 |
description | A tool for uniformly change file or directory names and support rollback these operations |
homepage | https://github.com/hobbymarks/fdn/ |
repository | https://github.com/hobbymarks/fdn/ |
max_upload_size | |
id | 1105280 |
size | 91,768 |
A tool for uniformly change file or directory names and support rollback these operations.
File or directory name format:
USB
,PCIe
...To install fdn via cargo:
$ cargo install fdn
Usage:
fdn [OPTIONS] [COMMAND]
Commands:
config Config pattern help Print this message or the help of the given subcommand(s)
Options:
-f, --file-path <FILE_PATH> file path [default: .]
-i, --in-place in place
-d, --max-depth <MAX_DEPTH> max depth [default: 1]
-t, --filetype <FILETYPE> file type,'f' for regular file and 'd' for directory [default: f]
-I, --not-ignore-hidden not ignore hidden file
-X, --exclude-path <EXCLUDE_PATH> exclude file or directory
-r, --reverse reverse change
-a, --align align origin and edited
-V, --version print version
-h, --help Print help
Use "fdn [command] --help" for more information about a command.
When you run fdn ,you will see two kinds of output:
First Kind:
sample▯file▯name -->sample_file_name
The output means: a file name sample file name
will be changed to
sample_file_name
-->
means in dry run mode ,operation not take effect.The character ▯
means space ,every space will be replaced by one ▯
.
The character ``▯`` is only for the convenience of visual contrast
and only display in output.
or
Second Kind:
sample▯file▯name ==>sample_file_name
The output means: a file named sample file name
has been changed to
sample_file_name
==>
means operation have taken effect.
all deleted character will be display as red color ,such as the original
file name:
sample ▯ file ▯ name
all added character will be diplayed as green color ,such as the changed
file name:
sample * file * name
-d option
$ fdn tgtroot -f -t dir -d 2 tgt_root/test directory/$0_T\▯Only -->tgt_root/test directory/$0_T_Only tgt_root/!临时文件夹 -->tgt_root/LSW 临时文件夹 tgt_root/_is▯dir▯% -->tgt_root/Is_dir% tgtroot/测试@#文件夹 -->tgt_root/CS 测试文件夹 tgt_root/test▯directory -->tgt_root/Test_Directory tgt_root -->Tgt_Root ************ In order to take effect,add option '-i' or '-c'
$ fdn tgt_root -f -t dir -d 1
tgt_root/!临时文件夹
-->tgt_root/LSW临时文件夹
tgt_root/_is▯dir▯%
-->tgt_root/Is_dir_%
tgt_root/测试@#文件夹
-->tgt_root/CS测试_文件夹
tgt_root/test▯directory
-->tgt_root/Test_Directory
tgt_root
-->Tgt_Root
********************************************************************
In order to take effect,add option '-i' or '-c'
-t option
$ fdn tgt_root -f -t dir
tgt_root/!临时文件夹
-->tgt_root/LSW临时文件夹
tgt_root/测试@#文件夹
-->tgt_root/CS测试_文件夹
tgt_root/test▯directory
-->tgt_root/Test_Directory
tgt_root/_is▯dir▯%
-->tgt_root/Is_dir_%
********************************************************************
In order to take effect,add option '-i' or '-c'
$ fdn tgt_root -f
tgt_root/thi_Is_File_%.mp4
-->tgt_root/Thi_Is_File_%.mp4
tgt_root/$0▯▯测试用文件.html
-->tgt_root/$0_测试用文件.html
********************************************************************
In order to take effect,add option '-i' or '-c'
-i option
$ fdn tgt_root/\$0\ \ 测试用文件.html -io
$0▯▯测试用文件.html
==>$0_测试用文件.html
-c option
$ fdn tgt_root/\$0\ \ 测试用文件.html -c
$0 测试用文件.html
Please confirm(y/n/A/q) [no]:
$0▯▯测试用文件.html
-->$0_测试用文件.html
$ fdn tgt_root/\$0\ \ 测试用文件.html -c
$0 测试用文件.html
Please confirm(y/n/A/q) [no]: y
$0▯▯测试用文件.html
==>$0_测试用文件.html
-l option
This Option
-f option
$ fdn tgt_root/\$0\ \ 测试用文件.html
$0▯▯测试用文件.html
-->$0_测试用文件.html
********************************************************************
In order to take effect,add option '-i' or '-c'
$ fdn tgt_root/\$0\ \ 测试用文件.html -f
tgt_root/$0▯▯测试用文件.html
-->tgt_root/$0_测试用文件.html
********************************************************************
In order to take effect,add option '-i' or '-c'
-a option
$ fdn
a▯Test-file.txt
-->A_Test_File.txt
********************************************************************
In order to take effect,add option '-i' or '-c'
$ fdn -a
/home/hma/a▯Test-file.txt
-->/home/hma/A_Test_File.txt
********************************************************************
In order to take effect,add option '-i' or '-c'
-r option
$ fdn tgt_root/\$0_测试用文件.html -r
$0_测试用文件.html
-->$0▯▯测试用文件.html
********************************************************************
In order to take effect,add option '-i' or '-c'
-o option
$ fdn tgt_root/\$0\ \ 测试用文件.html -i
Exist:$0_测试用文件.html
Skipped:$0 测试用文件.html
With option '-o' to enable overwrite.
$ fdn tgt_root/\$0\ \ 测试用文件.html -io
$0▯▯测试用文件.html
==>$0_测试用文件.html
-p option
$ fdn tgt_root
thi_Is_File_%.mp4
-->Thi_Is_File_%.mp4
$0▯▯测试用文件.html
-->$0_测试用文件.html
********************************************************************
In order to take effect,add option '-i' or '-c'
$ fdn tgt_root -p
thi_Is_File_%.mp4
-->Thi_Is_File_%.mp4
$0▯▯测试用文件.html
-->$0 _测试用文件.html
********************************************************************
In order to take effect,add option '-i' or '-c'
-e option
$ fdn tgt_root/\$0_测试用文件.html -re
$0_测试用文件.html
-->$0▯▯测试用文件.html
********************************************************************
In order to take effect,add option '-i' or '-c'
$ fdn tgt_root/\$0\ 测试用文件.html
$0▯测试用文件.html
-->$0_测试用文件.html
********************************************************************
In order to take effect,add option '-i' or '-c'
$ fdn tgt_root
$0▯测试用文件.html
-->$0_测试用文件.html
This▯is▯a▯Test▯file.pdf
-->This_Is_A_Test_File.pdf
_thi▯is▯file▯%.mp4
-->thi_Is_File_%.mp4
这是测试文件▯.jpg
-->ZSC这是测试文件.jpg
********************************************************************
In order to take effect,add option '-i' or '-c'
$ fdn tgt_root/\$0_测试用文件.html -r
$0_测试用文件.html
-->$0▯测试用文件.html
********************************************************************
In order to take effect,add option '-i' or '-c'
$ fdn tgt_root -r
This_Is_A_Test_File.pdf
-->This▯is▯a▯Test▯file.pdf
ZSC这是测试文件.jpg
-->这是测试文件▯.jpg
thi_Is_File_%.mp4
-->_thi▯▯is▯▯▯file▯%.mp4
$0_测试用文件.html
-->$0▯测试用文件.html
********************************************************************
In order to take effect,add option '-i' or '-c'
fd
/与 fd
工具联合工作fd is a program to find entries in your filesytem. It is a simple, fast and user-friendly alternative to find.*
$ fdfind -HIi html -x fdn -p {}
$0▯▯测试用文件.html
-->$0_测试用文件.html
********************************************************************
In order to take effect,add option '-i' or '-c'
$ fdfind -HIi html -x fdn -pf {}
tgt_root/$0▯▯测试用文件.html
-->tgt_root/$0 _测试用文件.html
********************************************************************
In order to take effect,add option '-i' or '-c'
一个小工具,用于日常统一更改文件(或者文件夹)名称
目前的具体格式:
USB
,PCIe
等;建议使用cargo进行安装:
$ cargo install fdn
请前往Usage/参数 查看
参考 Example/示例 查看