# file-size **Repository Path**: joncc/file-size ## Basic Information - **Project Name**: file-size - **Description**: 文件大小统计(支持命令) - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-07-27 - **Last Updated**: 2024-02-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # File Size ### 介绍 文件大小统计(支持命令) ### 使用说明 ```php //设置MB单位 FileSize::setUnitMB(); //设置文件大小1M FileSize::setSize(1); FileSize::addDir(__DIR__); FileSize::sizeStat(); ``` ### 命令 #### Mac 或 Linux 系统: 打开命令行窗口,将 `bin` 下的文件移动到 `/usr/bin/` 目录下面: ``` sudo chmod 755 fs sudo mv fs /usr/bin/fs ``` #### Windows 系统: 1. 找到并进入 PHP 的安装目录(和你在命令行中执行的 `php` 指令是同一套 PHP)。 2. 将 `bin` 目录下 `fs` 复制到 PHP 的安装目录下面,和 php.exe 在同一级目录。 3. 在 PHP 安装目录下新建一个 `fs.bat` 文件,并将下列代码保存到此文件中。 ``` @php "%~dp0fs" %* ``` 最后重新打开一个命令行窗口执行 `fs -h` 看是否正确输出帮助文档。 ``` Usage: fs [options]... Options: -d file directory -b unit B -k unit KB -m unit MB(default) -g unit GB -s file size(default 5MB) -a all the file size list -e empty files with file size exceeding the set value -r remove files with file size exceeding the set value -h,--help help ``` ### 地址 https://gitee.com/joncc/file-size