Differences

This shows you the differences between the selected revisions of the page.

scriptcommand_rm 2013-05-07 scriptcommand_rm 2020-05-29 (current)
Line 1: Line 1:
-====== rm ======+====== rm command ======
Removes one or more remote files. Removes one or more remote files.
 +
 +===== Syntax =====
  rm <file> [ <file2> ... ]   rm <file> [ <file2> ... ]
-If [[ui_login_environment#recycle_bin|remote recycle bin]] is configured, moves file to the bin instead of deleting it. Filename can be replaced with [[file_mask|wildcard]] to select multiple files.+===== [[remarks]] Remarks ===== 
 + 
 +If [[ui_login_recycle_bin|remote recycle bin]] is configured, moves file to the bin instead of deleting it. Filename can be replaced with [[file_mask|wildcard]] to select multiple files.
Can remove non-empty directories recursively. Can remove non-empty directories recursively.
 +
 +Effective [[scriptcommand_option|options]]: ''[[scriptcommand_option#failonnomatch|failonnomatch]]''
XML log element: ''[[logging_xml#rm|rm]]'' XML log element: ''[[logging_xml#rm|rm]]''
Line 13: Line 19:
<code winscp> <code winscp>
rm index.html rm index.html
 +</code>
 +<code winscp>
rm index.html about.html rm index.html about.html
 +</code>
 +<code winscp>
rm *.html rm *.html
</code> </code>
Line 20: Line 30:
When [[library_from_script|converting script to .NET Assembly]], map ''rm'' command to ''[[library_session_removefiles|Session.RemoveFiles]]'' method. When [[library_from_script|converting script to .NET Assembly]], map ''rm'' command to ''[[library_session_removefiles|Session.RemoveFiles]]'' method.
-Parameters mapping: Command parameter ''file'' maps to method parameter ''path''. When multiple source file parameters are used, you need to call ''Session.RemoveFiles'' multiple times. You have to [[library_from_script#paths|convert relative paths to absolute paths]].+Parameters mapping: Command parameter ''file'' maps to method parameter ''path''. When multiple file parameters are used, you need to call ''Session.RemoveFiles'' multiple times. You have to [[library_from_script#paths|convert relative paths to absolute paths]].
For example, following script snippet: For example, following script snippet:
Line 29: Line 39:
</code> </code>
-maps to following PowerShell code:+maps to following [[library_powershell|PowerShell]] code:
<code powershell> <code powershell>

Last modified: by martin