rclone ncdu

rclone ncdu

使用基于文本的用户界面探索远程存储。

概述

此命令会显示一个基于文本的用户界面,允许你浏览远程存储。它在回答“哪些内容占用了我所有的磁盘空间?”这个问题时非常有用。

为了创建这个用户界面,它首先会扫描指定的整个远程存储,并在内存中构建其表示形式。在扫描阶段就可以使用 rclone ncdu,你会看到它逐步构建目录结构。

你可以通过按键与用户界面进行交互,按下 ? 可切换帮助信息的显示与隐藏。支持的按键如下:

 ↑,↓ or k,j to Move
 →,l to enter
 ←,h to return
 g toggle graph
 c toggle counts
 a toggle average size in directory
 m toggle modified time
 u toggle human-readable format
 n,s,C,A,M sort by name,size,count,asize,mtime
 d delete file/directory
 v select file/directory
 V enter visual select mode
 D delete selected files/directories
 y copy current path to clipboard
 Y display current path
 ^L refresh screen (fix screen corruption)
 r recalculate file sizes
 ? to toggle help on and off
 ESC to close the menu box
 q/^c to quit

列出的文件/目录可能会以一个单字符标志作为前缀,有些还会在行尾的括号中附带说明。这些标志的含义如下:

e means this is an empty directory, i.e. contains no files (but
  may contain empty subdirectories)
~ means this is a directory where some of the files (possibly in
  subdirectories) have unknown size, and therefore the directory
  size may be underestimated (and average size inaccurate, as it
  is average of the files with known sizes).
. means an error occurred while reading a subdirectory, and
  therefore the directory size may be underestimated (and average
  size inaccurate)
! means an error occurred while reading this directory

这是对 ncdu 工具 的致敬,但针对的是 rclone 远程存储。目前它缺少很多功能,但就现状而言仍然很有用。与 ncdu 不同,它不会显示被排除的文件。

请注意,删除大文件/目录可能需要一些时间。在此期间,用户界面将无响应,因为删除操作是同步进行的。

如需对远程存储进行非交互式列表查看,请参阅 tree 命令。若只想获取远程存储的总大小,也可以使用 size 命令。

rclone ncdu remote:path [flags]

Options

  -h, --help   help for ncdu

接下来将介绍与其他命令共享的选项。 此处未列出的全局选项,请参阅全局标志页面

过滤器选项

用于过滤目录列表的标志

      --delete-excluded                     删除目标端中被排除在同步之外的文件
      --exclude stringArray                 排除符合指定模式的文件
      --exclude-from stringArray            从文件中读取要排除的文件模式(使用 - 从标准输入读取)
      --exclude-if-present stringArray      如果指定文件名存在,则排除该目录
      --files-from stringArray              从文件中读取源文件名列表(使用 - 从标准输入读取)
      --files-from-raw stringArray          从文件中读取源文件名列表,不对行进行任何处理(使用 - 从标准输入读取)
  -f, --filter stringArray                  添加文件过滤规则
      --filter-from stringArray             从文件中读取文件过滤模式(使用 - 从标准输入读取)
      --ignore-case                         在过滤时忽略大小写(大小写不敏感)
      --include stringArray                 包含符合指定模式的文件
      --include-from stringArray            从文件中读取要包含的文件模式(使用 - 从标准输入读取)
      --max-age Duration                    仅传输比指定时间(以秒或后缀 ms|s|m|h|d|w|M|y 表示)更新的文件(默认关闭)
      --max-depth int                       如果设置,则将递归深度限制为此值(默认 -1)
      --max-size SizeSuffix                 仅传输小于指定大小(以 KiB 或后缀 B|K|M|G|T|P 表示)的文件(默认关闭)
      --metadata-exclude stringArray        排除符合指定模式的元数据
      --metadata-exclude-from stringArray   从文件中读取要排除的元数据模式(使用 - 从标准输入读取)
      --metadata-filter stringArray         添加元数据过滤规则
      --metadata-filter-from stringArray    从文件中读取元数据过滤模式(使用 - 从标准输入读取)
      --metadata-include stringArray        包含符合指定模式的元数据
      --metadata-include-from stringArray   从文件中读取要包含的元数据模式(使用 - 从标准输入读取)
      --min-age Duration                    仅传输比指定时间(以秒或后缀 ms|s|m|h|d|w|M|y 表示)更旧的文件(默认关闭)
      --min-size SizeSuffix                 仅传输大于指定大小(以 KiB 或后缀 B|K|M|G|T|P 表示)的文件(默认关闭)

列表选项

列出目录的标志

      --default-time Time   Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z)
      --fast-list           Use recursive list if available; uses more memory but fewer transactions

参见

  • rclone - 显示 rclone 命令、标志和后端帮助。