Ren (command)
{{Short description|Shell command for renaming a file or directory}}
{{lowercase}}
{{Infobox software
| name = ren / rename
| logo =
| screenshot = ReactOS-0.4.13 ren command 667x434.png
| screenshot size =
| caption = The ReactOS ren
command
| developer = Various open-source and commercial developers
| released =
| latest release version =
| latest release date =
| operating system = OpenVOS, RT-11, OS/8, RSX-11, ISIS-II, iRMX 86, TOPS-20, Z80-RIO, FLEX, CDOS, OS-9, FlexOS, PC-MOS, 4690 OS, MPE/iX, THEOS/OASIS, OpenVMS, CP/M, MP/M, TRIPOS, AmigaDOS, DOS, MSX-DOS, SISNE plus, OS/2, Windows, ReactOS, SymbOS, DexOS
| platform = Cross-platform
| genre = Command
| license =
| website =
}}
ren
(or rename
) is a shell command for renaming a file and in some implementations (such as AmigaDOS{{Cite book|url=https://archive.org/details/1988-rugheimer-spanik-amigados-quick-reference|title=AmigaDOS quick reference|first1=Hannes|last1=Rügheimer|first2=Christian|last2=Spanik|date=September 19, 1988|publisher=Grand Rapids, Mi : Abacus|isbn=9781557550491|via=Internet Archive}}) a directory.
Some shells with {{code|ren}} also provide a move
command that provides for moving between directories. On systems that do not support a move
command (such as MS-DOS older than 6.00), the user could copy a file to a new destination and then delete the original file. In DOSBox, ren
can move files.
File:RT-11 help.jpg displayed on a VT100.]]
The command is in various shells such as COMMAND.COM, Command Prompt,{{Cite web|url=https://technet.microsoft.com/en-us/library/bb490987.aspx|title=Microsoft TechNet Rename (ren) article|date=11 September 2009 }} 4DOS, 4NT and PowerShell. In MS-DOS, the command is available in versions 1 and later.{{Cite book|author-last=Wolverton|author-first=Van|title=Running MS-DOS Version 6.22 (20th Anniversary Edition), 6th Revised edition|date=2003|publisher=Microsoft Press|isbn=0-7356-1812-7}} In PowerShell, ren
is a predefined alias for the Rename-Item
Cmdlet which serves the same essential purpose.{{cite web |url=https://technet.microsoft.com/en-us/library/ee176940.aspx |title=Microsoft TechNet PowerShell Rename-Item (ren) article|date=22 October 2009 }}
Similar commands are available in many operating systems. The command is available in the CP/M,{{cite web |url= http://www.cpm.z80.de/manuals/cpm22-m.pdf|title=Manual|website=www.cpm.z80.de |access-date=2020-09-19}} MP/M,{{cite book |author=Digital Research |author-link=Digital Research |title=MP/M - Multi-Programming Monitor Control Program - User's Guide |date=July 1981 |orig-year=1979 |edition=4 |publisher=Digital Research |location=Pacific Grove, CA, USA |url=http://www.cpm.z80.de/manuals/mpm1ug01.pdf |access-date=2017-01-04 |url-status=live |archive-url=https://web.archive.org/web/20170104231702/http://www.cpm.z80.de/manuals/mpm1ug01.pdf |archive-date=2017-01-04}}{{cite book |author=Digital Research |author-link=Digital Research |title=MP/M-86 Operating System - User's Guide |date=1981-09-25 |edition=1 |publisher=Digital Research |location=Pacific Grove, CA, USA |url=http://bitsavers.informatik.uni-stuttgart.de/pdf/digitalResearch/mpm-86/MPM-86_Users_Guide_Sep81.pdf |access-date=2017-01-04 |url-status=live |archive-url=https://web.archive.org/web/20170104172228/http://bitsavers.informatik.uni-stuttgart.de/pdf/digitalResearch/mpm-86/MPM-86_Users_Guide_Sep81.pdf |archive-date=2017-01-04}} Cromemco DOS,[http://www.hartetechnologies.com/manuals/Cromemco/CDOSv1.PDF CDOS USER'S MANUAL] TRIPOS,{{cite web |url=https://www.pagetable.com/docs/amigados_tripos/tripos_manuals.pdf |title= Manual |website=www.pagetable.com |access-date=2020-09-19}} OS/2,{{Cite web |url=http://www.jatomes.com/Help/Os2Cmd.php#RENAME |title=JaTomes Help - OS/2 Commands |access-date=2019-07-06 |archive-date=2019-04-14 |archive-url=https://web.archive.org/web/20190414130029/http://www.jatomes.com/Help/Os2Cmd.php#RENAME |url-status=dead }} ReactOS,{{Cite web|url=https://github.com/reactos/reactos|title=reactos/reactos|website=GitHub|date=3 January 2022}} SymbOS, and DexOS. Multics includes a rename
command to rename a directory entry; which could be contracted to rn
.{{Cite web|url=https://www.multicians.org/multics-commands.html|title=Multics Commands|website=www.multicians.org}} A {{code|rename}} command which in some cases can be contracted to ren
is provided in Stratus VOS,{{cite web |url=http://stratadoc.stratus.com/vos/19.1.0/r098-19/wwhelp/wwhimpl/common/html/r098-19.pdf |title= Manual |website=stratadoc.stratus.com |access-date=2020-09-19}} RT-11,{{Cite web|url=http://paleoferrosaurus.com/beta/documents/rt11help.html#RENAME|title=RT-11 HELP FILE|website=paleoferrosaurus.com|access-date=2018-07-16|archive-date=2018-07-17|archive-url=https://web.archive.org/web/20180717041552/http://paleoferrosaurus.com/beta/documents/rt11help.html#RENAME|url-status=dead}} OS/8,"Concise Command Language" (CCL).{{cite web
|url=http://bitsavers.trailing-edge.com/pdf/dec/pdp8/os8/OS8_Handbook_Apr1974.pdf
|title=OS/8 Handbook |date=April 1974 |access-date=28 November 2017}} RSX-11,{{Cite book |title=RSX A Guide for Users |date=1987 |author=John F. Pieper |publisher=Digital Equipment Corporation |url=http://www.rsx11m.com/rsxguide.pdf |isbn=0-932376-90-8 |access-date=2020-09-19}} ISIS-II,[http://bitsavers.org/pdf/intel/ISIS_II/9800306-06_ISIS-II_Users_Guide_May81.pdf ISIS II Users Guide] iRMX 86,[https://archive.org/details/bitsavers_inteliRMX1_19819263 iRMX™86 INTRODUCTION AND OPERATOR'S REFERENCE MANUAL For Release 6] TOPS-20,{{cite web
|url=http://www.textfiles.com/bitsavers/pdf/dec/pdp10/TOPS20/V6.1/AA-FP65A-TM_tops20CmdsRef.pdf
|title=TOPS-20 Command manual
|access-date=2018-07-18
|archive-date=2020-08-09
|archive-url=https://web.archive.org/web/20200809103116/http://www.textfiles.com/bitsavers/pdf/dec/pdp10/TOPS20/V6.1/AA-FP65A-TM_tops20CmdsRef.pdf
|url-status=dead
}} Z80-RIO,[https://www.z80cpu.eu/mirrors/oldcomputers.dyndns.org/public/pub/rechner/zilog/zds/z80-rio_os_userman.pdf Z80-RIO OPERATING SYSTEM USER'S MANUAL] FLEX,{{Cite web|url=http://www.flexusergroup.com/flexusergroup/pdfs/flex2um.pdf|title=FLEX 2.0 User's Manual}} OS-9,{{cite book|author=Paul S. Dayan|year=1992|title=The OS-9 Guru - 1 : The Facts|publisher=Galactic Industrial Limited|isbn=0-9519228-0-7}} FlexOS,{{cite web |url=http://www.bitsavers.org/pdf/digitalResearch/flexos/1073-2003_FlexOS_Users_Guide_V1.3_Nov86.pdf |title=FlexOS User's Guide |date=1986 |website=www.bitsavers.org |access-date=2020-09-19 |archive-date=2010-08-08 |archive-url=https://web.archive.org/web/20100808010315/http://www.bitsavers.org/pdf/digitalResearch/flexos/1073-2003_FlexOS_Users_Guide_V1.3_Nov86.pdf |url-status=dead }} 4690 OS,{{cite web |url= https://archive.org/details/4690OSV6r2UsersGuide/page/n169|title= Users guide |website= archive.org|format=PDF|access-date=2020-09-19}} MPE/iX,{{Cite web |url=http://www.teamnaconsulting.com/compresources/pdfs/c01687363.pdf |title=MPE/iX Command Reference Manual |access-date=2018-10-21 |archive-date=2018-10-21 |archive-url=https://web.archive.org/web/20181021232213/http://www.teamnaconsulting.com/compresources/pdfs/c01687363.pdf |url-status=dead }} THEOS/OASIS,[http://www.bitsavers.org/pdf/phaseOneSystems/THEOS_OASIS_Users_Handbook_1985.pdf THEOS/OASIS User's Handbook] and OpenVMS[https://www.itec.suny.edu/scsys/vms/OVMSDOC073/v73/6489/6489pro_005.html OpenVMS User's Manual]{{Dead link|date=October 2022 |bot=InternetArchiveBot |fix-attempted=yes }} A rename
command is supported by 86-DOS.{{cite book |title=86-DOS - Disk Operating System for the 8086 - User's Manual |edition=Preliminary |version=Version 0.3 |date=1980 |publisher=Seattle Computer Products, Inc. |location=Seattle, Washington, USA |url=http://www.patersontech.com/Dos/docs/86_Dos_usr_03.pdf |access-date=2019-07-14 |url-status=dead |archive-url=https://web.archive.org/web/20190714004434/http://www.patersontech.com/dos/docs/86_Dos_usr_03.pdf |archive-date=2019-07-14}} (59 pages) DR DOS 6.0 includes {{code|ren}} and {{code|rename}} commands.[https://www.4corn.co.uk/archive/docs/DR%20DOS%206.0%20User%20Guide-opt.pdf DR DOS 6.0 User Guide Optimisation and Configuration Tips] PC-MOS includes an implementation of rename
.[https://github.com/roelandjansen/pcmos386v501/blob/master/DOCS/v4/PCMOSv4UserManual.pdf PC-MOS User Guide]{{cite web|url=https://github.com/roelandjansen/pcmos386v501|title=pcmos386v501: PC-MOS/386 v5.01 final release including cdrom driver sources|first=Roeland|last=Jansen|date=8 February 2018|via=GitHub}} It is also available in the MS-DOS emulator DOSBox.
Example
The following renames file {{code|foo}} to {{code|bar}}.
> ren foo bar
The following renames a file specified by a fully qualified path. The first parameter may contain drive and path information, but the second parameter must be only a file name.
> rename "C:\Users\Public\Videos\Sample Videos\Wildlife.wmv" Wildlife2.wmv
The following removes abcd of a file name in Command Prompt based on the following rules:
- Same number of
/
as the number of characters to remove - Requries double quotes for both arguments
- Won't remove
.
from a file name
> rename "abcd*.txt" "////*.txt"
See also
{{Wikibooks|Guide to Windows Commands}}
References
{{Reflist}}
Further reading
- {{Cite book|author-last=Wolverton|author-first=Van|title=MS-DOS Commands: Microsoft Quick Reference, 4th Revised edition|date=1990|publisher=Microsoft Press|isbn=978-1556152894}}
- {{Cite book|author1=Kathy Ivens|author2=Brian Proffit|year=1993|title=OS/2 Inside & Out|publisher=Osborne McGraw-Hill|isbn=978-0078818714}}
- {{Cite book|first=Æleen|last=Frisch|year=2001|title=Windows 2000 Commands Pocket Reference|publisher=O'Reilly|isbn=978-0-596-00148-3}}
External links
- [https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/ren ren | Microsoft Docs]
{{Windows commands}}
Category:Internal DOS commands