openharmony 鸿蒙 kernel-small-debug-shell-file-du

2022-08-09 浏览 (747)

du

Command Function

This command is used to query the disk space occupied by a file.

Syntax

du [-kKmh] [file...]

Parameters

Table 1 Parameter description

ParameterDescription
--helpDisplays the parameters supported by the du command.
-kDisplays the occupied blocks, each of which is 1024 bytes by default.
-KDisplays the occupied blocks, each of which is 512 bytes (POSIX).
-mDisplays the disk space in MB.
-hDisplays the disk space in human-readable format K, M, and G, for example, 1K, 243M, or 2G.
fileSpecifies the target file.

Usage Guidelines

  • The du command is used to obtain the disk usage of a file rather than a directory.

  • The value of file must be the file name. It cannot contain the directory where the file is located.

Note

Currently, the shell does not support this command. mksh supports it. To switch to mksh, run cd bin and ./mksh.

Example

Run du -h testfile.

Output

Disk space occupied by testfile.

OHOS:/$ du -h testfile
1.8K    testfile

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Kernel

harmony 鸿蒙Kernel Coding Specification

harmony 鸿蒙Standard Libraries

harmony 鸿蒙Interrupt Management

harmony 鸿蒙Event

harmony 鸿蒙Mutex

harmony 鸿蒙Queue

harmony 鸿蒙Semaphore

harmony 鸿蒙Doubly Linked List

harmony 鸿蒙Memory Management

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/35c65bed11a047aeaa1934e6e72810e3