Skip to content

spo folder rename

Renames a folder


spo folder rename [options]


Option Description
--help output usage information
-u, --webUrl <webUrl> The URL of the site where the folder to be renamed is located
-f, --folderUrl <folderUrl> Site-relative URL of the folder (including the folder)
-n, --name New name for the target folder
-o, --output [output] Output type. json|text. Default text
--verbose Runs command with verbose logging
--debug Runs command with debug logging


Before using this command, log in to a SharePoint Online site, using the spo login command.


To rename a folder, you have to first log in to SharePoint using the spo login command, eg. spo login


Renames a folder with site-relative URL /Shared Documents/My Folder 1 located in site

spo folder rename --webUrl --folderUrl '/Shared Documents/My Folder 1' --name 'My Folder 2'