Ren (command) explained

ren / rename
Developer: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
Genre: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 (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 (command)|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

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 and 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

>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:

  1. Same number of '''/''' as the number of initial characters to remove.
  2. Double quotes for both arguments.
  3. It doesn't remove '''.''' from file name

See also

Further reading

External links

Notes and References

  1. Book: AmigaDOS quick reference. Hannes. Rügheimer. Christian. Spanik. September 19, 1988. Grand Rapids, Mi : Abacus. 9781557550491. Internet Archive.
  2. Web site: Manual. www.cpm.z80.de . 2020-09-19.
  3. Book: Digital Research . Digital Research . MP/M - Multi-Programming Monitor Control Program - User's Guide . July 1981 . 1979 . 4 . . Pacific Grove, CA, USA . 2017-01-04 . live . https://web.archive.org/web/20170104231702/http://www.cpm.z80.de/manuals/mpm1ug01.pdf . 2017-01-04.
  4. Book: Digital Research . Digital Research . MP/M-86 Operating System - User's Guide . 1981-09-25 . 1 . . Pacific Grove, CA, USA . 2017-01-04 . live . https://web.archive.org/web/20170104172228/http://bitsavers.informatik.uni-stuttgart.de/pdf/digitalResearch/mpm-86/MPM-86_Users_Guide_Sep81.pdf . 2017-01-04.
  5. http://www.hartetechnologies.com/manuals/Cromemco/CDOSv1.PDF CDOS USER'S MANUAL
  6. Web site: Manual . www.pagetable.com . 2020-09-19.
  7. Web site: JaTomes Help - OS/2 Commands . 2019-07-06 . 2019-04-14 . https://web.archive.org/web/20190414130029/http://www.jatomes.com/Help/Os2Cmd.php#RENAME . dead .
  8. Web site: Microsoft TechNet Rename (ren) article. 11 September 2009 .
  9. Web site: reactos/reactos. GitHub. 3 January 2022.
  10. Web site: Multics Commands. www.multicians.org.
  11. Web site: Manual . stratadoc.stratus.com . 2020-09-19.
  12. Web site: RT-11 HELP FILE. paleoferrosaurus.com. 2018-07-16. 2018-07-17. https://web.archive.org/web/20180717041552/http://paleoferrosaurus.com/beta/documents/rt11help.html#RENAME. dead.
  13. "Concise Command Language" (CCL).Web site: OS/8 Handbook . April 1974 . 28 November 2017.
  14. Book: RSX A Guide for Users . 1987 . John F. Pieper . Digital Equipment Corporation . 0-932376-90-8 . 2020-09-19.
  15. http://bitsavers.org/pdf/intel/ISIS_II/9800306-06_ISIS-II_Users_Guide_May81.pdf ISIS II Users Guide
  16. https://archive.org/details/bitsavers_inteliRMX1_19819263 iRMX™86 INTRODUCTION AND OPERATOR'S REFERENCE MANUAL For Release 6
  17. Web site: TOPS-20 Command manual. 2018-07-18. 2020-08-09. https://web.archive.org/web/20200809103116/http://www.textfiles.com/bitsavers/pdf/dec/pdp10/TOPS20/V6.1/AA-FP65A-TM_tops20CmdsRef.pdf. dead.
  18. 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
  19. Web site: FLEX 2.0 User's Manual.
  20. Book: Paul S. Dayan. 1992. The OS-9 Guru - 1 : The Facts. Galactic Industrial Limited. 0-9519228-0-7.
  21. Web site: FlexOS User's Guide . 1986 . www.bitsavers.org . 2020-09-19 . 2010-08-08 . https://web.archive.org/web/20100808010315/http://www.bitsavers.org/pdf/digitalResearch/flexos/1073-2003_FlexOS_Users_Guide_V1.3_Nov86.pdf . dead .
  22. Web site: Users guide . archive.org. PDF. 2020-09-19.
  23. Web site: MPE/iX Command Reference Manual . 2018-10-21 . 2018-10-21 . https://web.archive.org/web/20181021232213/http://www.teamnaconsulting.com/compresources/pdfs/c01687363.pdf . dead .
  24. http://www.bitsavers.org/pdf/phaseOneSystems/THEOS_OASIS_Users_Handbook_1985.pdf THEOS/OASIS User's Handbook
  25. https://www.itec.suny.edu/scsys/vms/OVMSDOC073/v73/6489/6489pro_005.html OpenVMS User's Manual
  26. Book: 86-DOS - Disk Operating System for the 8086 - User's Manual . Preliminary . Version 0.3 . 1980 . . Seattle, Washington, USA . 2019-07-14 . dead . https://web.archive.org/web/20190714004434/http://www.patersontech.com/dos/docs/86_Dos_usr_03.pdf . 2019-07-14. (59 pages)
  27. Book: Wolverton. Van. Running MS-DOS Version 6.22 (20th Anniversary Edition), 6th Revised edition. 2003. Microsoft Press. 0-7356-1812-7.
  28. 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
  29. Web site: Microsoft TechNet PowerShell Rename-Item (ren) article. 22 October 2009 .
  30. https://github.com/roelandjansen/pcmos386v501/blob/master/DOCS/v4/PCMOSv4UserManual.pdf PC-MOS User Guide
  31. Web site: pcmos386v501: PC-MOS/386 v5.01 final release including cdrom driver sources. Roeland. Jansen. 8 February 2018. GitHub.