Spec-Zone.ru › Nushell

rm for filesystem

Remove files and directories.

Signature

> rm {flags} ...rest

Flags

  • --trash, -t: Move to the platform's trash instead of permanently deleting. not used on android and ios.
  • --permanent, -p: Delete permanently, ignoring the 'always_trash' config option. always enabled on android and ios.
  • --recursive, -r: Delete subdirectories recursively.
  • --force, -f: Suppress error when no file.
  • --verbose, -v: Return a table for each processed path.
  • --interactive, -i: Ask user to confirm action.
  • --interactive-once, -I: Ask user to confirm action only once.
  • --all, -a: Remove hidden files if '*' is provided.

Parameters

  • ...rest: The file paths(s) to remove.

Input/output types:

input output
nothing nothing
nothing table<path: string, deleted: bool, error: oneof<nothing, string>>

Examples

Delete, or move a file to the trash (based on the 'always_trash' config option).

> rm file.txt

Move a file to the trash.

> rm --trash file.txt

Delete a file permanently, even if the 'always_trash' config option is true.

> rm --permanent file.txt

Delete a file, ignoring 'file not found' errors.

> rm --force file.txt

Delete all 0KB files in the current directory.

> ls | where size == 0KB and type == file | each { rm $in.name } | null

Copyright © 2019–2026 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/rm.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API