rm command

Removes one or more remote files.

Advertisement

Syntax

rm <file> [ <file2> ... ]

Remarks

If remote recycle bin is configured, moves file to the bin instead of deleting it. Filename can be replaced with wildcard to select multiple files.

Can remove non-empty directories recursively.

Effective options: failonnomatch

XML log element: rm

Examples

rm index.html
rm index.html about.html
rm *.html

Advertisement

Converting to .NET Assembly

When converting script to .NET Assembly, map rm command to Session.RemoveFiles method.

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 convert relative paths to absolute paths.

For example, following script snippet:

cd /home/martinp/public_html
rm index.html about.html

maps to following PowerShell code:

$session.RemoveFiles("/home/martinp/public_html/index.html")
$session.RemoveFiles("/home/martinp/public_html/about.html")

Last modified: by martin