harmony 鸿蒙du

  • 2022-08-09
  • 浏览 (611)

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

Parameter Description
–help Displays the parameters supported by the du command.
-k Displays the occupied blocks, each of which is 1024 bytes by default.
-K Displays the occupied blocks, each of which is 512 bytes (POSIX).
-m Displays the disk space in MB.
-h Displays the disk space in human-readable format K, M, and G, for example, 1K, 243M, or 2G.
file Specifies 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

0  赞