一种易于使用的程序,通过将所有松散文件放在一个具有指定子文件夹的文件夹中来清除指定的目录。
DirectoryCleaner的Python项目详细描述
目录清除器
因为当你厌倦了那些垃圾为什么?
这个应用程序的主要关注点是尽可能容易地清理目录,这些目录中只放置了一堆不太重要的松散文件。出于明显的原因,我不建议在软件项目目录中使用此选项。它是完全可自定义的,任何默认名称都可以更改,如果出于某种原因,您不喜欢默认文件夹名称,甚至可能是非常有创意的名称目录清除器。
设置
首先用pip安装。
pip install DirectoryCleaner
然后,这将使目录清除器可以从您的路径中使用。要测试此类型
DirectoryCleaner -h
如果你得到了帮助命令,你就一切就绪了。
特定于Windows的额外步骤
如果还没有,请使用此命令将cmd的默认编码设置为utf-8。
chcp 65001
示例用法
最基本的用法是用所有默认名称清理一个凌乱的目录。默认名称的格式为(文件扩展名)文件扩展名的全名。例如,PNG文件的默认名称是(PNG)可移植网络图形。默认的目录名是directorycleaner(当前日期)。
DirectoryCleaner /users/username/desktop
分组文件
-gf或--group_files标志将公共文件类型组合到默认的组目录名中。例如,jpg、jpeg、png、tif、tiff、gif、bmp、eps、raw、cr2、nef、orf和sr2格式的所有图像文件都将放置在具有此标志集的“images”文件夹中。
DirectoryCleaner /users/username/desktop -gf
更改默认值
使用这三个标志,您可以更改将要放置文件的所有默认目录名。他们给你的提示将告诉你如何改变它们。任何名称更改后,这些名称将成为每次运行程序时的新默认值。
DirectoryCleaner /users/username/desktop -mfn -cfn -cgn
恢复默认设置
有了这个标志,你可以恢复到默认设置,如果你决定你实际上爱和错过了明智的默认设置。
DirectoryCleaner /users/username/Desktop -rs
忽略点文件
如果不想清理宝贵的点文件,可以传入--ignore\dotfiles或-idf标志。默认情况下,除非您有一个以公共文件扩展名命名的点文件(这种情况很少发生),否则点文件将被放置在名为“未知”的文件夹中。
DirectoryCleaner /users/username/desktop -idf
命令
positional arguments:
path The path to the directory that you want to cleanup not
actually the word path. Ex. DirectoryCleaner
/Users/Username/desktop
optional arguments:
-h, --help show this help message and exit
--folder_cleanup, -fc
Set this flag if you want folders to also be included
in the clean up.
--main_folder_name, -mfn
Set this flag and specify the name you would like the
main folder to be called. The date will always be
apart of the name, only DirectoryCleaner will be
changed.
--revert_settings, -rs
Revert the settings file to its default state when the
program was downloaded. Will use the default settings
to run the program as well.
--group_files, -gf Set this flag if you would like to group commonly used
files like Word Docs, Excel files, PDFs, music files
etc. in folders named after the type of media they
are.
--change_folder_names, -cfn
Set this flag if you want to rename one of the default
folder names Directory Cleaner uses for that type of
file.
--change_group_names, -cgn
Set this flag if you'd like to rename one of the
default group names.
--ignore_dotfiles, -idf
Set this flag if instead of placing dotfiles in an
'Unknowns' folder, you simply want them ignored.