Skip to content

Commit

Permalink
25/02/16
Browse files Browse the repository at this point in the history
  • Loading branch information
WindRunnerMax committed Feb 16, 2025
1 parent 9af49f0 commit dcf4d7f
Show file tree
Hide file tree
Showing 6 changed files with 128 additions and 12 deletions.
1 change: 1 addition & 0 deletions .scripts/docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ export const docs: Record<string, string[]> = {
"Linux/ip-网络接口管理",
"Linux/curl-网络数据传输",
"Linux/top-系统资源监控",
"Linux/du-磁盘占用管理"
],
MiniProgram: [
"MiniProgram/山科小站小程序",
Expand Down
5 changes: 3 additions & 2 deletions Backup/基于MVC模式的编辑器架构设计.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,10 @@ next(length) {
}
```

### 视图层

以此我们简单定义了描述数据模型的状态,以及可以用来截取数据结构的迭代器。这部分是描述数据结构内容以及变更的基础,当然在这里我们精简了非常多的内容,因此看起来比较简单。实际上这里还有非常复杂的实现,例如如何实现`immutable`来减少重复渲染保证性能。

### 视图层
视图层主要负责渲染数据模型,

### 控制器

Expand Down
114 changes: 114 additions & 0 deletions I18N/Linux/du-磁盘占用管理.md
Original file line number Diff line number Diff line change
@@ -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

- <https://github.com/WindrunnerMax/EveryDay>

## References

- <https://www.computerhope.com/unix/udu.htm>
- <https://linuxize.com/post/du-command-in-linux/>
- <https://www.runoob.com/linux/linux-comm-du.html>
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,10 @@ find . -maxdepth 1 -print0 | xargs -0 du -sh | grep tsconfig.json # Mac

## 每日一题

```
https://github.com/WindrunnerMax/EveryDay
```
- <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
```
- <https://www.computerhope.com/unix/udu.htm>
- <https://linuxize.com/post/du-command-in-linux/>
- <https://www.runoob.com/linux/linux-comm-du.html>
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
如果觉得还不错,点个`star`吧 😁

<!-- Summary Start -->
版本库中共有`492`篇文章,总计`93032`行,`1100418`字,`3056825`字符。
版本库中共有`493`篇文章,总计`93141`行,`1102073`字,`3060315`字符。
<!-- Summary End -->

这是一个前端小白的学习历程,如果只学习而不记录点什么那基本就等于白学了。这个版本库的名字`EveryDay`就是希望激励我能够每天学习,下面的文章就是从`2020.02.25`开始积累的文章,都是参考众多文章归纳整理学习而写的。文章包括了`HTML`基础、`CSS`基础、`JavaScript`基础与拓展、`Browser`浏览器相关、`Vue`使用与分析、`React`使用与分析、`Plugin`插件相关、`RichText`富文本、`Patterns`设计模式、`Linux`命令、`LeetCode`题解等类别,内容都是比较基础的,毕竟我也还是个小白。此外基本上每个示例都是本着能够即时运行为目标的,新建一个`HTML`文件复制之后即可在浏览器运行或者直接可以在`console`中运行。
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion Timeline.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit dcf4d7f

Please sign in to comment.