Linux mren Command
-- Learning not just technology, but dreams!
- Home
- HTML
- JavaScript
- CSS
- Vue
- React
- Python3
- Java
- C
- C++
- C#
- AI
- Go
- SQL
- Linux
- VS Code
- Bootstrap
- Git
- Local Bookmarks
Linux Tutorial
Linux Tutorial Linux Introduction Linux Installation Linux Cloud Server WSL Install Linux Linux System Boot Process Linux System Directory Structure Linux Forgot Password Solution Linux Remote Login Linux File Basic Attributes Linux File and Directory Management Linux User and User Group Management Linux Disk Management Linux vi/vim Linux yum Command Linux apt Command
Shell Tutorial
Shell Tutorial Shell Variables Shell Passing Arguments Shell Arrays Shell Operators Shell echo Command Shell printf Command Shell test Command Shell Flow Control Shell Functions Shell Input/Output Redirection Shell File Inclusion
Linux Reference Manual
Linux Command Manual Nginx Installation and Configuration MySQL Installation and Configuration Linux Quiz
Nginx Installation and Configuration
Deep Dive
- Web Service
- Computer Science
- Programming Languages
- Software
- Programming
- Web Design & Development
- Development Tools
- Scripting Languages
- Web Services
- Scripting
Linux mren Command
The Linux mren command is used to rename MS-DOS files or directories, or to move files or directories.
mren is an MS-DOS utility command, similar to the ren command in DOS, which can rename MS-DOS files or directories.
The source file must be a file that already exists on the disk. If the drive letter and path are omitted, it refers to the file in the current drive and current directory.
The new file name is the name to be changed to. The new file name cannot have a different drive letter and path than the source file, because this command can only change the file name on the same drive.
Syntax
mren [source file or directory...]
Parameter Description:
[source file or directory...]: The source file name or source file path to perform the operation on.: The target file name or target file path to perform the operation on.
Example
Use the command mren to change the name of the file "autorun.bat" on drive A to "auto.bat", enter the following command:
$ mren a:autorun.bat auto.bat #Rename file autorun.bat to auto.bat
Use the mdir command before and after using this command to view and compare, the results are as follows:
$ mdir -/ a:* #View files on drive A
Volume in drive A has no label #Load information
Volume Serial Number is 13D2~055C
Directory for A: #Directory information below
./TEST <DIR> 2011-08-23 16:59 #File name, directory size, modification time
AUTORUN.BAT 43 2011-08-23 16:56
3 files 308 bytes #Total size
724 325 bytes free #Remaining space
#Rename file autorun.bat to auto.bat
$ mren a:autorun.bat auto.bat
$ mdir -/ a:* #View files on drive A again
Volume in drive A has no label #Load information
Volume Serial Number is 13D2~055C
Directory for A: #Directory information below
./TEST <DIR> 2011-08-23 16:59 #File name, directory size, modification time
#File name changed to auto.bat, modification time changed to current system time
AUTO.BAT 43 2011-08-23 16:56
3 files 308 bytes #Total size
724 325 bytes free #Remaining space
YouTip