utility
mv
Rename or move an object. May overwrite destinations; cross-filesystem moves can require copying and removing.
Formal Syntax & Structure
bash syntaxbash
mv [OPTION] SOURCE DESTParameters & Attributes
| Name | Type | Description |
|---|---|---|
| SOURCE | path | Source path. |
| DEST | path | Destination path. |
Return Value
exit status
Exit status 0 on success; nonzero indicates failure or a command-specific condition. See description and example.
Working Example
Example Snippetbash
mkdir -- reportsprintf 'ready\n' > reports/draft.txtmv -- reports/draft.txt 'reports/final report.txt'cat -- 'reports/final report.txt'