Differences
This shows you the differences between the selected revisions of the page.
| scriptcommand_mv 2013-05-07 | scriptcommand_mv 2020-05-29 (current) | ||
| Line 1: | Line 1: | ||
| - | ====== mv ====== | + | ====== mv command ====== |
| [[task_move_duplicate|Moves]] or renames one or more remote files. | [[task_move_duplicate|Moves]] or renames one or more remote files. | ||
| + | |||
| + | ===== Syntax ===== | ||
| mv <file> [ <file2> ... ] [ <directory>/ ][ <newname> ] | mv <file> [ <file2> ... ] [ <directory>/ ][ <newname> ] | ||
| + | |||
| + | ===== Remarks ===== | ||
| Destination ''directory'' or ''newname'' or both must be specified. Destination directory must end with slash. [[operation_mask|Operation mask]] can be used instead of new name. Filename can be replaced with [[file_mask|wildcard]] to select multiple files. | Destination ''directory'' or ''newname'' or both must be specified. Destination directory must end with slash. [[operation_mask|Operation mask]] can be used instead of new name. Filename can be replaced with [[file_mask|wildcard]] to select multiple files. | ||
| Alias: ''rename'' | Alias: ''rename'' | ||
| + | |||
| + | Effective [[scriptcommand_option|options]]: ''[[scriptcommand_option#failonnomatch|failonnomatch]]'' | ||
| XML log element: ''[[logging_xml#mv|mv]]'' | XML log element: ''[[logging_xml#mv|mv]]'' | ||
| Line 15: | Line 21: | ||
| <code winscp> | <code winscp> | ||
| mv index.html public_html/ | mv index.html public_html/ | ||
| + | </code> | ||
| + | <code winscp> | ||
| mv index.html about.* | mv index.html about.* | ||
| + | </code> | ||
| + | <code winscp> | ||
| mv index.html public_html/about.* | mv index.html public_html/about.* | ||
| + | </code> | ||
| + | <code winscp> | ||
| mv public_html/index.html public_html/about.html /home/martin/*.bak | mv public_html/index.html public_html/about.html /home/martin/*.bak | ||
| + | </code> | ||
| + | <code winscp> | ||
| mv *.html /home/backup/*.bak | mv *.html /home/backup/*.bak | ||
| </code> | </code> | ||
| - | ===== Converting to .NET Assembly ===== | + | ===== [[net]] Converting to .NET Assembly ===== |
| When [[library_from_script|converting script to .NET Assembly]], map ''mv'' command to ''[[library_session_movefile|Session.MoveFile]]'' method. | When [[library_from_script|converting script to .NET Assembly]], map ''mv'' command to ''[[library_session_movefile|Session.MoveFile]]'' method. | ||
| Line 33: | Line 47: | ||
| </code> | </code> | ||
| - | maps to following PowerShell code: | + | maps to following [[library_powershell|PowerShell]] code: |
| <code powershell> | <code powershell> | ||