rename - Quickly rename a file or directory
rename ENDPOINT/OLD-PATH ENDPOINT/NEW-PATH
The rename command renames a file or directory on an endpoint.
The old path must be an existing file or directory. The new path must not yet exist.
The new path does not have to be in the same directory as the old path, but most endpoints will require it to stay on the same filesystem (you can not rename across a filesystem boundary).
The endpoint name must be entered twice (in the old and new paths) for the sake of path syntax consistency.
Automatic Endpoint Activation
If an endpoint is not activated, this command will attempt to auto-activate it. Otherwise, the command will fail, and direct the user to run endpoint-activate and/or display a web URL for OAuth activation.
This command supports the following endpoint identification formats:
"^test_bookmark". The bookmark name must be prepended with a
"^"character. The bookmark name may have URL-escaped characters. If the bookmark name contains a "/", it must be URL-escaped as "%2F".
"bob#test_endpoint". This contains the user who owns the endpoint and the endpoint legacy name.
Unqualified Legacy Name:
"test_endpoint". The user name defaults to the current logged in user.
File and directory path(s) given as input are assumed to be URL-encoded. For example, "%20" is equivalent to a space (" "). A literal "%" character must be encoded as "%25".
Rename a directory:
$ rename go#ep1/~/tempdir go#ep1/~/project-foo
rename returns 0 on success, and 1 if a network or server error occurred.