Ren (command): Difference between revisions
Filled in 6 bare reference(s) with reFill 2 |
JalenBarks (talk | contribs) m Reverted edits by 114.10.99.57 (talk) (HG) (3.4.12) |
||
(23 intermediate revisions by 14 users not shown) | |||
Line 1: | Line 1: | ||
{{Short description|Computer command}} |
|||
{{lowercase}} |
{{lowercase}} |
||
{{Cleanup bare URLs|date=September 2020}} |
|||
{{Infobox software |
{{Infobox software |
||
| name = ren / rename |
| name = ren / rename |
||
Line 11: | Line 11: | ||
| latest release version = |
| latest release version = |
||
| latest release date = |
| latest release date = |
||
| operating system = [[Stratus VOS|OpenVOS]], [[RT-11]], [[OS/8]], [[RSX-11]], [[ISIS (operating system)|ISIS-II]], [[RMX (operating system)|iRMX 86]], [[TOPS-20]], [[Z80-RIO]], [[FLEX (operating system)|FLEX]], [[Cromemco DOS|CDOS]], [[OS-9]], [[FlexOS]], [[PC-MOS]], [[4690 Operating System|4690 OS]], [[HP Multi-Programming Executive|MPE/iX]], [[THEOS|THEOS/OASIS]], [[OpenVMS]], [[CP/M]], [[MP/M]], [[TRIPOS]], [[AmigaDOS]], [[DOS]], [[MSX-DOS]], [[SISNE plus]], [[OS/2]], [[Microsoft Windows|Windows]], [[ReactOS]], [[SymbOS]], |
| operating system = [[Stratus VOS|OpenVOS]], [[RT-11]], [[OS/8]], [[RSX-11]], [[ISIS (operating system)|ISIS-II]], [[RMX (operating system)|iRMX 86]], [[TOPS-20]], [[Z80-RIO]], [[FLEX (operating system)|FLEX]], [[Cromemco DOS|CDOS]], [[OS-9]], [[FlexOS]], [[PC-MOS]], [[4690 Operating System|4690 OS]], [[HP Multi-Programming Executive|MPE/iX]], [[THEOS|THEOS/OASIS]], [[OpenVMS]], [[CP/M]], [[MP/M]], [[TRIPOS]], [[AmigaDOS]], [[DOS]], [[MSX-DOS]], [[SISNE plus]], [[OS/2]], [[Microsoft Windows|Windows]], [[ReactOS]], [[SymbOS]], DexOS |
||
| platform = [[Cross-platform]] |
| platform = [[Cross-platform]] |
||
| genre = [[Command (computing)|Command]] |
| genre = [[Command (computing)|Command]] |
||
Line 17: | Line 17: | ||
| website = |
| website = |
||
}} |
}} |
||
In [[computing]], '''<code>ren</code>''' (or '''<code>rename</code>''') is a [[command (computing)|command]] in various [[command-line interpreter]]s ([[Shell (computing)|shells]]) such as <code>[[COMMAND.COM]]</code>, <code>[[cmd.exe]]</code>, [[4DOS]], [[4NT (shell)|4NT]] and [[Windows PowerShell]]. It is used to [[rename (computing)|rename]] [[computer file]]s and in some implementations (such as [[AmigaDOS]]<ref>{{Cite |
In [[computing]], '''<code>ren</code>''' (or '''<code>rename</code>''') is a [[command (computing)|command]] in various [[command-line interpreter]]s ([[Shell (computing)|shells]]) such as <code>[[COMMAND.COM]]</code>, <code>[[cmd.exe]]</code>, [[4DOS]], [[4NT (shell)|4NT]] and [[Windows PowerShell]]. It is used to [[rename (computing)|rename]] [[computer file]]s and in some implementations (such as [[AmigaDOS]]<ref>{{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}}</ref>) also [[directory (computing)|directories]]. It is analogous to the [[Unix]] <code>[[mv (Unix)|mv]]</code> command. However, unlike <code>mv</code>, <code>ren</code> cannot be used to move files, as a new directory for the destination file may not be used. Alternatively, <code>[[move (command)|move]]</code> may be used if available. On versions of MS-DOS that do not support the <code>move</code> command (older than 6.00), the user would simply copy the file to a new destination, and then delete the original file. A notable exception to this rule is [[DOSBox]], in which <code>ren</code> may be used to move a file, since <code>move</code> is not supported. |
||
==Implementations== |
==Implementations== |
||
[[File:RT-11 help.jpg|thumb|Description of the <code>RENAME</code> command of [[:en:RT-11|RT-11SJ]] displayed on a [[:en:VT100|VT100]].]] |
[[File:RT-11 help.jpg|thumb|Description of the <code>RENAME</code> command of [[:en:RT-11|RT-11SJ]] displayed on a [[:en:VT100|VT100]].]] |
||
The command is available in the operating systems [[Digital Research]] [[CP/M]],<ref>http://www.cpm.z80.de/manuals/cpm22-m.pdf</ref> [[MP/M]],<ref name="mpm1">{{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}}</ref><ref name="MP/M_1981_UG">{{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}}</ref> [[Cromemco]] [[Cromemco DOS|CDOS]],<ref>[http://www.hartetechnologies.com/manuals/Cromemco/CDOSv1.PDF CDOS USER'S MANUAL]</ref> [[MetaComCo]] [[TRIPOS]],<ref>https://www.pagetable.com/docs/amigados_tripos/tripos_manuals.pdf</ref> [[DOS]], [[IBM]] [[OS/2]],<ref>http://www.jatomes.com/Help/Os2Cmd.php#RENAME</ref> [[Microsoft]] [[Microsoft Windows|Windows]],<ref>{{Cite web|url=https://technet.microsoft.com/en-us/library/bb490987.aspx|title=Microsoft TechNet Rename (ren) article}}</ref> [[ReactOS]],<ref>{{Cite web|url=https://github.com/reactos/reactos|title=reactos/reactos|website=GitHub}}</ref> [[SymbOS]], and |
The command is available in the operating systems [[Digital Research]] [[CP/M]],<ref>{{cite web |url= http://www.cpm.z80.de/manuals/cpm22-m.pdf|title=Manual|website=www.cpm.z80.de |access-date=2020-09-19}}</ref> [[MP/M]],<ref name="mpm1">{{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}}</ref><ref name="MP/M_1981_UG">{{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}}</ref> [[Cromemco]] [[Cromemco DOS|CDOS]],<ref>[http://www.hartetechnologies.com/manuals/Cromemco/CDOSv1.PDF CDOS USER'S MANUAL]</ref> [[MetaComCo]] [[TRIPOS]],<ref>{{cite web |url=https://www.pagetable.com/docs/amigados_tripos/tripos_manuals.pdf |title= Manual |website=www.pagetable.com |access-date=2020-09-19}}</ref> [[DOS]], [[IBM]] [[OS/2]],<ref>{{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 }}</ref> [[Microsoft]] [[Microsoft Windows|Windows]],<ref>{{Cite web|url=https://technet.microsoft.com/en-us/library/bb490987.aspx|title=Microsoft TechNet Rename (ren) article|date=11 September 2009 }}</ref> [[ReactOS]],<ref>{{Cite web|url=https://github.com/reactos/reactos|title=reactos/reactos|website=GitHub|date=3 January 2022}}</ref> [[SymbOS]], and DexOS. |
||
[[Multics]] includes a <code>rename</code> command to rename a directory entry. It can be contracted to <code>rn</code>.<ref>{{Cite web|url=https://www.multicians.org/multics-commands.html|title=Multics Commands|website=www.multicians.org}}</ref> |
[[Multics]] includes a <code>rename</code> command to rename a directory entry. It can be contracted to <code>rn</code>.<ref>{{Cite web|url=https://www.multicians.org/multics-commands.html|title=Multics Commands|website=www.multicians.org}}</ref> |
||
[[Stratus Technologies|Stratus]] [[Stratus VOS|OpenVOS]],<ref>http://stratadoc.stratus.com/vos/19.1.0/r098-19/wwhelp/wwhimpl/common/html/r098-19.pdf</ref> [[Digital Equipment Corporation|DEC]] [[RT-11]],<ref>{{Cite web|url=http://paleoferrosaurus.com/beta/documents/rt11help.html#RENAME|title=RT-11 HELP FILE|website=paleoferrosaurus.com}}</ref> [[OS/8]],<ref name="OS8.HandB">"Concise Command Language" (CCL).{{cite web |
[[Stratus Technologies|Stratus]] [[Stratus VOS|OpenVOS]],<ref>{{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}}</ref> [[Digital Equipment Corporation|DEC]] [[RT-11]],<ref>{{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}}</ref> [[OS/8]],<ref name="OS8.HandB">"Concise Command Language" (CCL).{{cite web |
||
|url=http://bitsavers.trailing-edge.com/pdf/dec/pdp8/os8/OS8_Handbook_Apr1974.pdf |
|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}}</ref> [[RSX-11]],<ref>{{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 | |
|title=OS/8 Handbook |date=April 1974 |access-date=28 November 2017}}</ref> [[RSX-11]],<ref>{{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}}</ref> [[Intel]] [[ISIS (operating system)|ISIS-II]],<ref>[http://bitsavers.org/pdf/intel/ISIS_II/9800306-06_ISIS-II_Users_Guide_May81.pdf ISIS II Users Guide]</ref> [[RMX (operating system)|iRMX 86]],<ref>[https://archive.org/details/bitsavers_inteliRMX1_19819263 iRMX™86 INTRODUCTION AND OPERATOR'S REFERENCE MANUAL For Release 6]</ref> [[TOPS-20]],<ref name=CMDref>{{cite web |
||
|url=http://www.textfiles.com/bitsavers/pdf/dec/pdp10/TOPS20/V6.1/AA-FP65A-TM_tops20CmdsRef.pdf |
|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 |
|||
⚫ | }}</ref> [[Zilog]] [[Z80-RIO]],<ref>[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]</ref> [[Technical Systems Consultants|TSC]] [[FLEX (operating system)|FLEX]],<ref>{{Cite web|url=http://www.flexusergroup.com/flexusergroup/pdfs/flex2um.pdf|title=FLEX 2.0 User's Manual}}</ref> [[Microware]] [[OS-9]],<ref>{{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}}</ref> DR [[FlexOS]],<ref>{{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 }}</ref> IBM/[[Toshiba]] [[4690 Operating System|4690 OS]],<ref>{{cite web |url= https://archive.org/details/4690OSV6r2UsersGuide/page/n169|title= Users guide |website= archive.org|format=PDF|access-date=2020-09-19}}</ref> [[Hewlett-Packard|HP]] [[HP Multi-Programming Executive|MPE/iX]],<ref>{{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 }}</ref> [[THEOS|THEOS/OASIS]],<ref>[http://www.bitsavers.org/pdf/phaseOneSystems/THEOS_OASIS_Users_Handbook_1985.pdf THEOS/OASIS User's Handbook]</ref> and [[OpenVMS]]<ref>[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 }}</ref> also provide the <code>rename</code> command which in some cases can be contracted to <code>ren</code>. |
||
The <code>rename</code> command is supported by [[Tim Paterson]]'s [[Seattle Computer Products|SCP]] [[86-DOS]].<ref>{{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)</ref> On [[MS-DOS]], the command is available in versions 1 and later.<ref name="RUNNINGMSDOS">{{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}}</ref> [[DR DOS 6.0]] also includes an implementation of the {{code|ren}} and {{code|rename}} commands.<ref name="drdos6userguide">[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]</ref> |
The <code>rename</code> command is supported by [[Tim Paterson]]'s [[Seattle Computer Products|SCP]] [[86-DOS]].<ref>{{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)</ref> On [[MS-DOS]], the command is available in versions 1 and later.<ref name="RUNNINGMSDOS">{{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}}</ref> [[DR DOS 6.0]] also includes an implementation of the {{code|ren}} and {{code|rename}} commands.<ref name="drdos6userguide">[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]</ref> |
||
In [[Windows PowerShell]], <code>ren</code> is a predefined [[Alias (command)|command alias]] for the <code>Rename-Item</code> Cmdlet which basically serves the same purpose.<ref>{{cite web |url=https://technet.microsoft.com/en-us/library/ee176940.aspx |title=Microsoft TechNet PowerShell Rename-Item (ren) article}}</ref> |
In [[Windows PowerShell]], <code>ren</code> is a predefined [[Alias (command)|command alias]] for the <code>Rename-Item</code> Cmdlet which basically serves the same purpose.<ref>{{cite web |url=https://technet.microsoft.com/en-us/library/ee176940.aspx |title=Microsoft TechNet PowerShell Rename-Item (ren) article|date=22 October 2009 }}</ref> |
||
[[The Software Link|TSL]] [[PC-MOS]] includes an implementation of <code>rename</code>.<ref>[https://github.com/roelandjansen/pcmos386v501/blob/master/DOCS/v4/PCMOSv4UserManual.pdf PC-MOS User Guide]</ref> |
[[The Software Link|TSL]] [[PC-MOS]] includes an implementation of <code>rename</code>.<ref>[https://github.com/roelandjansen/pcmos386v501/blob/master/DOCS/v4/PCMOSv4UserManual.pdf PC-MOS User Guide]</ref> |
||
Like the rest of the operating system, it is licensed under the [[GPL v3]].<ref>{{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 |
Like the rest of the operating system, it is licensed under the [[GPL v3]].<ref>{{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}}</ref> |
||
It is also available in the [[Open-source license|open source]] MS-DOS [[emulator]] [[DOSBox]]. |
It is also available in the [[Open-source license|open source]] MS-DOS [[emulator]] [[DOSBox]]. |
||
==Example== |
==Example== |
||
<syntaxhighlight lang=" |
<syntaxhighlight lang="doscon"> |
||
ren filename newname |
>ren filename newname |
||
ren *.htm *.html |
>ren *.htm *.html |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
Another example. This will rename a default video found in [[Windows 7]] with a new name: |
Another example. This will rename a default video found in [[Windows 7]] with a new name: |
||
<syntaxhighlight lang=" |
<syntaxhighlight lang="doscon"> |
||
rename "C:\Users\Public\Videos\Sample Videos\Wildlife.wmv" "Wildlife2.wmv" |
>rename "C:\Users\Public\Videos\Sample Videos\Wildlife.wmv" "Wildlife2.wmv" |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
The first parameter ''may'' contain a drive and a path, but the second parameter must contain only the new filename. |
The first parameter ''may'' contain a drive and a path, but the second parameter must contain only the new filename. |
||
To remove certain characters of a file name in Microsoft Windows command prompt (XP & Higher) : |
|||
<syntaxhighlight lang="doscon"> |
|||
>rename "abcd*.txt" "////*.txt" |
|||
</syntaxhighlight>This will remove '''''abcd''''' from the file name. |
|||
Notes: |
|||
# Same number of <code>'''/'''</code> as the number of initial characters to remove. |
|||
# Double quotes for both arguments. |
|||
# It doesn't remove <code>'''.'''</code> from file name |
|||
<!-- |
<!-- |
||
Line 64: | Line 82: | ||
Linux example(second Unix style example): |
Linux example(second Unix style example): |
||
For e.g. if You want to rename all of files in Your actual terminal catalogue ending in (old name).jpg to (old name)_myphotos.jpg You have to write<ref>{{cite web|url=http://www.go2linux.org/rename-bulk-files-with-linux-console-command |title=Rename multiple files with Linux |publisher=Go2linux.org |date |
For e.g. if You want to rename all of files in Your actual terminal catalogue ending in (old name).jpg to (old name)_myphotos.jpg You have to write<ref>{{cite web|url=http://www.go2linux.org/rename-bulk-files-with-linux-console-command |title=Rename multiple files with Linux |publisher=Go2linux.org |access-date=2012-05-02}}</ref>: |
||
<syntaxhighlight lang="bash"> |
<syntaxhighlight lang="bash"> |
||
rename -v 's/\.jpg$/\_myphotos.jpg/' *.jpg |
rename -v 's/\.jpg$/\_myphotos.jpg/' *.jpg |
||
Line 95: | Line 113: | ||
[[Category:CP/M commands]] |
[[Category:CP/M commands]] |
||
[[Category:Internal DOS commands]] |
[[Category:Internal DOS commands]] |
||
[[Category:MSX-DOS commands]] |
|||
[[Category:OS/2 commands]] |
[[Category:OS/2 commands]] |
||
[[Category:ReactOS commands]] |
|||
[[Category:Windows commands]] |
[[Category:Windows commands]] |
||
[[Category:Microcomputer software]] |
[[Category:Microcomputer software]] |
Latest revision as of 17:40, 26 June 2024
Developer(s) | Various open-source and commercial developers |
---|---|
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 |
Type | Command |
In computing, ren
(or rename
) is a command in various command-line interpreters (shells) such as COMMAND.COM
, cmd.exe
, 4DOS, 4NT and Windows PowerShell. It is used to rename computer files and in some implementations (such as AmigaDOS[1]) also directories. It is analogous to the Unix mv
command. However, unlike mv
, ren
cannot be used to move files, as a new directory for the destination file may not be used. Alternatively, move
may be used if available. On versions of MS-DOS that do not support the move
command (older than 6.00), the user would simply copy the file to a new destination, and then delete the original file. A notable exception to this rule is DOSBox, in which ren
may be used to move a file, since move
is not supported.
Implementations
[edit]The command is available in the operating systems Digital Research CP/M,[2] MP/M,[3][4] Cromemco CDOS,[5] MetaComCo TRIPOS,[6] DOS, IBM OS/2,[7] Microsoft Windows,[8] ReactOS,[9] SymbOS, and DexOS.
Multics includes a rename
command to rename a directory entry. It can be contracted to rn
.[10]
Stratus OpenVOS,[11] DEC RT-11,[12] OS/8,[13] RSX-11,[14] Intel ISIS-II,[15] iRMX 86,[16] TOPS-20,[17] Zilog Z80-RIO,[18] TSC FLEX,[19] Microware OS-9,[20] DR FlexOS,[21] IBM/Toshiba 4690 OS,[22] HP MPE/iX,[23] THEOS/OASIS,[24] and OpenVMS[25] also provide the rename
command which in some cases can be contracted to ren
.
The rename
command is supported by Tim Paterson's SCP 86-DOS.[26] On MS-DOS, the command is available in versions 1 and later.[27] DR DOS 6.0 also includes an implementation of the ren
and rename
commands.[28]
In Windows PowerShell, ren
is a predefined command alias for the Rename-Item
Cmdlet which basically serves the same purpose.[29]
TSL PC-MOS includes an implementation of rename
.[30]
Like the rest of the operating system, it is licensed under the GPL v3.[31]
It is also available in the open source MS-DOS emulator DOSBox.
Example
[edit]>ren filename newname
>ren *.htm *.html
Another example. This will rename a default video found in Windows 7 with a new name:
>rename "C:\Users\Public\Videos\Sample Videos\Wildlife.wmv" "Wildlife2.wmv"
The first parameter may contain a drive and a path, but the second parameter must contain only the new filename.
To remove certain characters of a file name in Microsoft Windows command prompt (XP & Higher) :
>rename "abcd*.txt" "////*.txt"
This will remove abcd from the file name.
Notes:
- Same number of
/
as the number of initial characters to remove. - Double quotes for both arguments.
- It doesn't remove
.
from file name
See also
[edit]References
[edit]- ^ Rügheimer, Hannes; Spanik, Christian (September 19, 1988). AmigaDOS quick reference. Grand Rapids, Mi : Abacus. ISBN 9781557550491 – via Internet Archive.
- ^ "Manual" (PDF). www.cpm.z80.de. Retrieved 2020-09-19.
- ^ Digital Research (July 1981) [1979]. MP/M - Multi-Programming Monitor Control Program - User's Guide (PDF) (4 ed.). Pacific Grove, CA, USA: Digital Research. Archived (PDF) from the original on 2017-01-04. Retrieved 2017-01-04.
- ^ Digital Research (1981-09-25). MP/M-86 Operating System - User's Guide (PDF) (1 ed.). Pacific Grove, CA, USA: Digital Research. Archived (PDF) from the original on 2017-01-04. Retrieved 2017-01-04.
- ^ CDOS USER'S MANUAL
- ^ "Manual" (PDF). www.pagetable.com. Retrieved 2020-09-19.
- ^ "JaTomes Help - OS/2 Commands". Archived from the original on 2019-04-14. Retrieved 2019-07-06.
- ^ "Microsoft TechNet Rename (ren) article". 11 September 2009.
- ^ "reactos/reactos". GitHub. 3 January 2022.
- ^ "Multics Commands". www.multicians.org.
- ^ "Manual" (PDF). stratadoc.stratus.com. Retrieved 2020-09-19.
- ^ "RT-11 HELP FILE". paleoferrosaurus.com. Archived from the original on 2018-07-17. Retrieved 2018-07-16.
- ^ "Concise Command Language" (CCL)."OS/8 Handbook" (PDF). April 1974. Retrieved 28 November 2017.
- ^ John F. Pieper (1987). RSX A Guide for Users (PDF). Digital Equipment Corporation. ISBN 0-932376-90-8. Retrieved 2020-09-19.
- ^ ISIS II Users Guide
- ^ iRMX™86 INTRODUCTION AND OPERATOR'S REFERENCE MANUAL For Release 6
- ^ "TOPS-20 Command manual" (PDF). Archived from the original (PDF) on 2020-08-09. Retrieved 2018-07-18.
- ^ Z80-RIO OPERATING SYSTEM USER'S MANUAL
- ^ "FLEX 2.0 User's Manual" (PDF).
- ^ Paul S. Dayan (1992). The OS-9 Guru - 1 : The Facts. Galactic Industrial Limited. ISBN 0-9519228-0-7.
- ^ "FlexOS User's Guide" (PDF). www.bitsavers.org. 1986. Archived from the original (PDF) on 2010-08-08. Retrieved 2020-09-19.
- ^ "Users guide" (PDF). archive.org. Retrieved 2020-09-19.
- ^ "MPE/iX Command Reference Manual" (PDF). Archived from the original (PDF) on 2018-10-21. Retrieved 2018-10-21.
- ^ THEOS/OASIS User's Handbook
- ^ OpenVMS User's Manual[permanent dead link ]
- ^ 86-DOS - Disk Operating System for the 8086 - User's Manual (PDF). Version 0.3 (Preliminary ed.). Seattle, Washington, USA: Seattle Computer Products, Inc. 1980. Archived from the original (PDF) on 2019-07-14. Retrieved 2019-07-14. (59 pages)
- ^ Wolverton, Van (2003). Running MS-DOS Version 6.22 (20th Anniversary Edition), 6th Revised edition. Microsoft Press. ISBN 0-7356-1812-7.
- ^ DR DOS 6.0 User Guide Optimisation and Configuration Tips
- ^ "Microsoft TechNet PowerShell Rename-Item (ren) article". 22 October 2009.
- ^ PC-MOS User Guide
- ^ Jansen, Roeland (8 February 2018). "pcmos386v501: PC-MOS/386 v5.01 final release including cdrom driver sources" – via GitHub.
Further reading
[edit]- Wolverton, Van (1990). MS-DOS Commands: Microsoft Quick Reference, 4th Revised edition. Microsoft Press. ISBN 978-1556152894.
- Kathy Ivens; Brian Proffit (1993). OS/2 Inside & Out. Osborne McGraw-Hill. ISBN 978-0078818714.
- Frisch, Æleen (2001). Windows 2000 Commands Pocket Reference. O'Reilly. ISBN 978-0-596-00148-3.