Nushell
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
  • 한국어
GitHub
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
  • 한국어
GitHub
  • Categories

    • Bits
    • Bytes
    • Chart
    • Conversions
    • Core
    • Database
    • Dataframe
    • Dataframe Or Lazyframe
    • Date
    • Debug
    • Default
    • Env
    • Experimental
    • Expression
    • Filesystem
    • Filters
    • Formats
    • Generators
    • Hash
    • History
    • Lazyframe
    • Math
    • Misc
    • Network
    • Path
    • Platform
    • Plugin
    • Prompt
    • Random
    • Removed
    • Shells
    • Strings
    • System
    • Viewers

mv for filesystem

Move files or directories using uutils/coreutils mv.

Signature

> mv {flags} ...rest

Flags

  • --force, -f: Do not prompt before overwriting.
  • --verbose, -v: Explain what is being done.
  • --progress, -p: Display a progress bar.
  • --interactive, -i: Prompt before overwriting.
  • --update, -u: Move and overwrite only when the SOURCE file is newer than the destination file or when the destination file is missing.
  • --no-clobber, -n: Do not overwrite an existing file.
  • --all, -a: Move hidden files if '*' is provided.

Parameters

  • ...rest: Rename SRC to DST, or move SRC to DIR.

Input/output types:

inputoutput
nothingnothing

Examples

Rename a file.

> mv before.txt after.txt

Move a file into a directory.

> mv test.txt my/subdirectory

Move only if source file is newer than target file.

> mv -u new/test.txt old/

Move many files into a directory.

> mv *.txt my/subdirectory

Move a file into the "my" directory two levels up in the directory tree.

> mv test.txt .../my/