English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Linux-Befehl mren

Linux Command Manual

Der Linux-Befehl mren wird verwendet, um den Namen von MS-DOS-Datei- oder Verzeichnisname, oder das Verschieben von Dateien oder Verzeichnissen.

mren ist MS-DOS-Toolanweisung, ähnlich wie das ren-Befehl unter DOS, kann den Namen von MS-DOS-Datei- oder Verzeichnisname.

Die Quelldatei muss eine auf dem Laufwerk vorhandene Datei sein. Wird das Laufwerk und der Pfad ignoriert, bezieht sich dies auf die Datei im aktuellen Verzeichnis.

Der neue Dateiname ist der zu ändernde Dateiname. Vor dem neuen Dateinamen darf keine andere Laufwerksbezeichnung und Pfad stehen, da dieser Befehl nur den Dateinamen auf demselben Laufwerk ändern kann.

Syntax

mren [ Quel Datei- oder Verzeichnis...][ Ziel Datei- oder Verzeichnis]

参数说明:

  • [Source file or directory…]: Source file name or source file path for the operation to be performed

  • [Target file or directory]: Target file name or target file path for the operation to be performed

Online Examples

Use the mren command to change the filename of the file "autorun.bat" under drive A to "auto.bat", input the following command:

$ mren a:\autorun.bat auto.bat  
#Rename file autorun.bat to auto.bat

Use the mdir command before and after using the command to compare the results as follows:

$ mdir -/ a:\*                  #View files in drive A  
Volume in drive A has no label                                                #Loading Information  
Volume Serial Number is 13D2~055C  
Directory for A:\                                                            #Directory Information  
./TEST <DIR> 2018-08-23 16:59       #Filename, directory size, modification time  
AUTORUN.BAT 43 2018-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:\*                  #Recheck files in drive A  
Volume in drive A has no label                                                #Loading Information  
Volume Serial Number is 13D2~055C  
Directory for A:\                                                            #Directory Information  
./TEST <DIR> 2018-08-23 16:59       #Filename, directory size, modification time  
#Filename changed to auto.bat, modification time changed to current system time  
AUTO.BAT 43 2018-08-23 16:56          
3 files 308 bytes                                             #Total Size  
724 325 bytes free                                         #Remaining Space

Linux Command Manual