From dcf4d7f21efc8450f4ce5137b807f73b2ec47b47 Mon Sep 17 00:00:00 2001 From: WindRunnerMax <651525974@qq.com> Date: Sun, 16 Feb 2025 13:03:11 +0800 Subject: [PATCH] 25/02/16 --- .scripts/docs.ts | 1 + ...66\346\236\204\350\256\276\350\256\241.md" | 5 +- ...40\347\224\250\347\256\241\347\220\206.md" | 114 ++++++++++++++++++ ...40\347\224\250\347\256\241\347\220\206.md" | 12 +- README.md | 3 +- Timeline.md | 5 +- 6 files changed, 128 insertions(+), 12 deletions(-) create mode 100644 "I18N/Linux/du-\347\243\201\347\233\230\345\215\240\347\224\250\347\256\241\347\220\206.md" rename "Backup/du-\347\243\201\347\233\230\345\215\240\347\224\250\347\256\241\347\220\206.md" => "Linux/du-\347\243\201\347\233\230\345\215\240\347\224\250\347\256\241\347\220\206.md" (95%) diff --git a/.scripts/docs.ts b/.scripts/docs.ts index 0def190..330085d 100644 --- a/.scripts/docs.ts +++ b/.scripts/docs.ts @@ -401,6 +401,7 @@ export const docs: Record = { "Linux/ip-网络接口管理", "Linux/curl-网络数据传输", "Linux/top-系统资源监控", + "Linux/du-磁盘占用管理" ], MiniProgram: [ "MiniProgram/山科小站小程序", diff --git "a/Backup/\345\237\272\344\272\216MVC\346\250\241\345\274\217\347\232\204\347\274\226\350\276\221\345\231\250\346\236\266\346\236\204\350\256\276\350\256\241.md" "b/Backup/\345\237\272\344\272\216MVC\346\250\241\345\274\217\347\232\204\347\274\226\350\276\221\345\231\250\346\236\266\346\236\204\350\256\276\350\256\241.md" index fba9430..af05946 100644 --- "a/Backup/\345\237\272\344\272\216MVC\346\250\241\345\274\217\347\232\204\347\274\226\350\276\221\345\231\250\346\236\266\346\236\204\350\256\276\350\256\241.md" +++ "b/Backup/\345\237\272\344\272\216MVC\346\250\241\345\274\217\347\232\204\347\274\226\350\276\221\345\231\250\346\236\266\346\236\204\350\256\276\350\256\241.md" @@ -86,9 +86,10 @@ next(length) { } ``` -### 视图层 - +以此我们简单定义了描述数据模型的状态,以及可以用来截取数据结构的迭代器。这部分是描述数据结构内容以及变更的基础,当然在这里我们精简了非常多的内容,因此看起来比较简单。实际上这里还有非常复杂的实现,例如如何实现`immutable`来减少重复渲染保证性能。 +### 视图层 +视图层主要负责渲染数据模型, ### 控制器 diff --git "a/I18N/Linux/du-\347\243\201\347\233\230\345\215\240\347\224\250\347\256\241\347\220\206.md" "b/I18N/Linux/du-\347\243\201\347\233\230\345\215\240\347\224\250\347\256\241\347\220\206.md" new file mode 100644 index 0000000..8d70cee --- /dev/null +++ "b/I18N/Linux/du-\347\243\201\347\233\230\345\215\240\347\224\250\347\256\241\347\220\206.md" @@ -0,0 +1,114 @@ +# Disk Usage Management with du + +The `du` command abbreviates `Disk Usage` and is used to estimate and display disk usage of files and directories within the file system. + +## Syntax + +```bash +du [OPTION]... [FILE]... +du [OPTION]... --files0-from=F +``` + +## Options +* `-a, --all`: Count all files, including directories. +* `--apparent-size`: Print apparent sizes instead of disk usage. Apparent sizes are generally smaller, but they may be larger due to holes in sparse files, internal fragmentation, and indirect blocks. +* `-B, --block-size=SIZE`: Scale sizes before printing by `SIZE`. For example, `-BM` prints sizes in units of `1,048,576` bytes. +* `-b, --bytes`: Equivalent to `--apparent-size --block-size=1`. +* `-c, --total`: Show grand total. +* `-D, --dereference-args`: Dereference only the arguments listed on the command line. +* `--files0-from=F`: Estimate disk usage of files specified in file `F`, where each name is terminated by a null character. If `F` is `-`, reads names from standard input. +* `-H`: Equivalent to `--dereference-args (-D)`. +* `-h, --human-readable`: Print sizes in human-readable format, rounding values and using abbreviations. For example, `1K`, `234M`, `2G`, etc. +* `--si`: Similar to `-h`, but uses powers of `1000` instead of `1024`. +* `-k`: Similar to `--block-size=1K`. +* `-l, --count-links`: Count sizes multiple times (if there are hard links). +* `-m`: Similar to `--block-size=1M`. +* `-L, --dereference`: Dereference all symbolic links. +* `-P, --no-dereference`: Do not follow any symbolic links (default behavior). +* `-0, --null`: Use a null byte to terminate each output line instead of a newline. +* `-S, --separate-dirs`: Do not include size of subdirectories. +* `-s, --summarize`: Display only a total for each argument. +* `-x, --one-file-system`: Skip directories on different filesystems. +* `-X, --exclude-from=FILE`: Exclude files matching patterns in `FILE`. +* `--exclude=PATTERN`: Exclude files matching `PATTERN`. +* `-d, --max-depth=N`: Print total only if directory (or file with `--all`) is at most `N` levels below the command line arguments, `--max-depth=0` is equivalent to `--summarize`. +* `--time`: Show last modification time of any file or its subdirectories in the directory. +* `--time=WORD`: Show time according to `WORD`: `atime`, `access`, `use`, `ctime`, or `status`. +* `--time-style=STYLE`: Show time using `STYLE`: `full-iso`, `long-iso`, `iso`, or `+` format (interpretation of `FORMAT` is like `date`). +* `--help`: Display help information and exit. +* `--version`: Output version information and exit. + +## Examples + +Display the disk space occupied by the current directory and its subdirectories. + +```bash +du -h +``` + +Show disk usage of a specific directory, recursively showing usage by default. + +```bash +du -h /home +``` + +Recursively show space occupied by every file and subdirectory in a directory, finally summarizing total usage. + +```bash +du -ah /home +``` + +Show space usage of immediate subdirectories in the current directory. + +```bash +du -h -d 1 +``` + +Display disk usage of the current directory. + +```bash +du -h -d 0 +``` + +Show disk space usage of the file system (disk free). + +```bash +df -h +``` + +Display disk usage of all files and subdirectories in the current directory, sorted by size. + +```bash +du -a -h -d 1 | sort -h -r +``` + +Show disk usage of all files and subdirectories in the current directory, excluding certain folders, and sort by size. + +```bash +du -a -h -d 1 --exclude=.git --exclude=node_modules | sort -h -r +find . -maxdepth 1 \( -path ./.git -o -path ./node_modules \) -prune -o -exec du -sh {} + | sort -h -r # Mac +``` + +Check the size of a specific file. + +```bash +du -h tsconfig.json +``` + +Filter and view the volume of a file using `grep`, useful when dealing with symbolic links. + +```bash +ls -l -h tsconfig.json +du -a -h -d 1 | grep tsconfig.json +find . -maxdepth 1 -print0 | xargs -0 du -sh | grep tsconfig.json # Mac +``` + +## Question of the Day + +- + +## References + +- +- +- \ No newline at end of file diff --git "a/Backup/du-\347\243\201\347\233\230\345\215\240\347\224\250\347\256\241\347\220\206.md" "b/Linux/du-\347\243\201\347\233\230\345\215\240\347\224\250\347\256\241\347\220\206.md" similarity index 95% rename from "Backup/du-\347\243\201\347\233\230\345\215\240\347\224\250\347\256\241\347\220\206.md" rename to "Linux/du-\347\243\201\347\233\230\345\215\240\347\224\250\347\256\241\347\220\206.md" index 864c12e..b5b4251 100644 --- "a/Backup/du-\347\243\201\347\233\230\345\215\240\347\224\250\347\256\241\347\220\206.md" +++ "b/Linux/du-\347\243\201\347\233\230\345\215\240\347\224\250\347\256\241\347\220\206.md" @@ -105,14 +105,10 @@ find . -maxdepth 1 -print0 | xargs -0 du -sh | grep tsconfig.json # Mac ## 每日一题 -``` -https://github.com/WindrunnerMax/EveryDay -``` +- ## 参考 -``` -https://www.computerhope.com/unix/udu.htm -https://linuxize.com/post/du-command-in-linux/ -https://www.runoob.com/linux/linux-comm-du.html -``` +- +- +- diff --git a/README.md b/README.md index 1f4be4c..01b07d2 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ 如果觉得还不错,点个`star`吧 😁 -版本库中共有`492`篇文章,总计`93032`行,`1100418`字,`3056825`字符。 +版本库中共有`493`篇文章,总计`93141`行,`1102073`字,`3060315`字符。 这是一个前端小白的学习历程,如果只学习而不记录点什么那基本就等于白学了。这个版本库的名字`EveryDay`就是希望激励我能够每天学习,下面的文章就是从`2020.02.25`开始积累的文章,都是参考众多文章归纳整理学习而写的。文章包括了`HTML`基础、`CSS`基础、`JavaScript`基础与拓展、`Browser`浏览器相关、`Vue`使用与分析、`React`使用与分析、`Plugin`插件相关、`RichText`富文本、`Patterns`设计模式、`Linux`命令、`LeetCode`题解等类别,内容都是比较基础的,毕竟我也还是个小白。此外基本上每个示例都是本着能够即时运行为目标的,新建一个`HTML`文件复制之后即可在浏览器运行或者直接可以在`console`中运行。 @@ -418,6 +418,7 @@ * [ip-网络接口管理](Linux/ip-网络接口管理.md) [(*en-us*)](I18N/Linux/ip-网络接口管理.md) * [curl-网络数据传输](Linux/curl-网络数据传输.md) [(*en-us*)](I18N/Linux/curl-网络数据传输.md) * [top-系统资源监控](Linux/top-系统资源监控.md) [(*en-us*)](I18N/Linux/top-系统资源监控.md) +* [du-磁盘占用管理](Linux/du-磁盘占用管理.md) [(*en-us*)](I18N/Linux/du-磁盘占用管理.md) ## MiniProgram * [山科小站小程序](MiniProgram/山科小站小程序.md) [(*en-us*)](I18N/MiniProgram/山科小站小程序.md) diff --git a/Timeline.md b/Timeline.md index 7c2438f..8e5200a 100644 --- a/Timeline.md +++ b/Timeline.md @@ -1,6 +1,9 @@ # Timeline -前端笔记系列共有 428 篇文章,总计 76654 行, 879563 字, 2438524 字符。 +前端笔记系列共有 429 篇文章,总计 76769 行, 880536 字, 2441026 字符。 + +### 2025-02-16 +第 429 题:[du-磁盘占用管理](Linux/du-磁盘占用管理.md) ### 2025-02-15 第 428 题:[Canvas编辑器之层级渲染事件管理](Plugin/Canvas编辑器之层级渲染事件管理.md)