Ren (command)

ren (or rename ) is a shell command for renaming a file and in some implementations (such as AmigaDOS ) a directory.

Uses your system voice; voice and rate in settings.

Snapshot

≈ 8 min read

Names in other languages

No names in other languages are held for this entry yet.

Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.

ren (or rename) is a shell command for renaming a file and in some implementations (such as AmigaDOS[1]) a directory.

Some shells with 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.

The command is in various shells such as COMMAND.COM, Command Prompt,[2] 4DOS, 4NT and PowerShell. In MS-DOS, the command is available in versions 1 and later.[3] In PowerShell, ren is a predefined alias for the Rename-Item Cmdlet which serves the same essential purpose.[4]

Similar commands are available in many operating systems. The command is available in the CP/M,[5] MP/M,[6][7] Cromemco DOS,[8] TRIPOS,[9] OS/2,[10] ReactOS,[11] SymbOS, and DexOS. Multics includes a rename command to rename a directory entry, which could be contracted to rn.[12] A rename command which in some cases can be contracted to ren is provided in Stratus VOS,[13] RT-11,[14] OS/8,[15] RSX-11,[16] ISIS-II,[17] iRMX 86,[18] TOPS-20,[19] Z80-RIO,[20] FLEX,[21] OS-9,[22] FlexOS,[23] 4690 OS,[24] MPE/iX,[25] THEOS/OASIS,[26] and OpenVMS[27] A rename command is supported by 86-DOS.[28] DR DOS 6.0 includes ren and rename commands.[29] PC-MOS includes an implementation of rename.[30][31] It is also available in the MS-DOS emulator DOSBox.

Example

edit edit source

The following renames file foo to 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

edit edit source Wikibooks has a book on the topic of: Guide to Windows Commands

References

edit edit source
  1. ^ Rügheimer, Hannes; Spanik, Christian (September 19, 1988). AmigaDOS quick reference. Grand Rapids, Mi : Abacus. ISBN 9781557550491 – via Internet Archive.
  2. ^ "Microsoft TechNet Rename (ren) article". 11 September 2009.
  3. ^ Wolverton, Van (2003). Running MS-DOS Version 6.22 (20th Anniversary Edition), 6th Revised edition. Microsoft Press. ISBN 0-7356-1812-7.
  4. ^ "Microsoft TechNet PowerShell Rename-Item (ren) article". 22 October 2009.
  5. ^ "Manual" (PDF). www.cpm.z80.de. Retrieved 2020-09-19.
  6. ^ 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.
  7. ^ 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.
  8. ^ CDOS USER'S MANUAL Wikipedia revision 1378833505, retrieved 2026-11-18
  9. ^ "Manual" (PDF). www.pagetable.com. Retrieved 2020-09-19.
  10. ^ "JaTomes Help - OS/2 Commands". Archived from the original on 2019-04-14. Retrieved 2019-07-06.
  11. ^ "reactos/reactos". GitHub. 3 January 2022.
  12. ^ "Multics Commands". www.multicians.org. Wikipedia revision 1378833505, retrieved 2026-11-18
  13. ^ "Manual" (PDF). stratadoc.stratus.com. Retrieved 2020-09-19.
  14. ^ "RT-11 HELP FILE". paleoferrosaurus.com. Archived from the original on 2018-07-17. Retrieved 2018-07-16.
  15. ^ "Concise Command Language" (CCL). "OS/8 Handbook" (PDF). April 1974. Retrieved 28 November 2017.
  16. ^ John F. Pieper (1987). RSX A Guide for Users (PDF). Digital Equipment Corporation. ISBN 0-932376-90-8. Retrieved 2020-09-19.
  17. ^ ISIS II Users Guide Wikipedia revision 1378833505, retrieved 2026-11-18
  18. ^ iRMX™86 INTRODUCTION AND OPERATOR'S REFERENCE MANUAL For Release 6 Wikipedia revision 1378833505, retrieved 2026-11-18
  19. ^ "TOPS-20 Command manual" (PDF). Archived from the original (PDF) on 2020-08-09. Retrieved 2018-07-18.
  20. ^ "Z80-RIO OPERATING SYSTEM USER'S MANUAL" (PDF). Archived from the original (PDF) on 2022-01-28. Retrieved 2019-05-04.
  21. ^ "FLEX 2.0 User's Manual" (PDF). Wikipedia revision 1378833505, retrieved 2026-11-18
  22. ^ Paul S. Dayan (1992). The OS-9 Guru - 1 : The Facts. Galactic Industrial Limited. ISBN 0-9519228-0-7.
  23. ^ "FlexOS User's Guide" (PDF). www.bitsavers.org. 1986. Archived from the original (PDF) on 2010-08-08. Retrieved 2020-09-19.
  24. ^ "Users guide" (PDF). archive.org. Retrieved 2020-09-19.
  25. ^ "MPE/iX Command Reference Manual" (PDF). Archived from the original (PDF) on 2018-10-21. Retrieved 2018-10-21.
  26. ^ THEOS/OASIS User's Handbook Wikipedia revision 1378833505, retrieved 2026-11-18
  27. ^ OpenVMS User's Manual[permanent dead link] Wikipedia revision 1378833505, retrieved 2026-11-18
  28. ^ 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)
  29. ^ DR DOS 6.0 User Guide Optimisation and Configuration Tips Wikipedia revision 1378833505, retrieved 2026-11-18
  30. ^ PC-MOS User Guide Wikipedia revision 1378833505, retrieved 2026-11-18
  31. ^ Jansen, Roeland (8 February 2018). "pcmos386v501: PC-MOS/386 v5.01 final release including cdrom driver sources" – via GitHub.

Further reading

edit edit source edit edit source Windows command-line programs and shell builtinsEcosystem File system navigation File management Archiving Disk management Processes Registry User environment File contents Scripting Networking Maintenance and care Boot management Software development Miscellaneous

Text derived from https://en.wikipedia.org/w/index.php?oldid=1378833505 under CC BY-SA 4.0; modifications have been made.