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

Linux mren command

مجلة الأوامر في Linux

The Linux mren command is used to change the name of MS-DOS files or directories, or to move files or directories.

mren is an MS-DOS command tool, similar to the ren command under DOS, which can change the name of MS-DOS files or directories.

The source file must be a file that already exists on the disk. If the drive and path are ignored, it means the file in the current drive and current directory.

The new file name is the desired file name to be replaced. The new file name cannot be prefixed with a different drive and path than the source file, because this command can only change the file name of the same drive.

Syntax

mren [source file or directory...][target file or directory]

Parameter description:

  • [Source file or directory…]: Source file name or source file path to be executed

  • [Target file or directory]: Target file name or target file path to be executed

Online Example

Use the command mren 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  
#تم إعادة تسمية ملف autorun.bat إلى auto.bat

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

$ mdir -/ -a:\*                                                               # view files in drive a:  
لا يوجد اسم للقرص في المحرك A  
رقم سلسلة الحجم هو 13D2~055C  
مجلد للوصول إلى A:\  
./TEST <DIR> 2018-08-23 16:59 #اسم الملف، حجم المجلد، تاريخ التعديل  
AUTORUN.BAT 43 2018-08-23 16:56  
3 ملفات 308 بايت  
724 325 بايت متاحين  
#تم إعادة تسمية ملف autorun.bat إلى auto.bat  
$ mren a:\autorun.bat auto.bat        
$ mdir -/ a:\*  
لا يوجد اسم للقرص في المحرك A  
رقم سلسلة الحجم هو 13D2~055C  
مجلد للوصول إلى A:\  
./TEST <DIR> 2018-08-23 16:59 #اسم الملف، حجم المجلد، تاريخ التعديل  
#تم تغيير اسم الملف إلى auto.bat وعدل تاريخ التعديل إلى تاريخ النظام الحالي  
AUTO.BAT 43 2018-08-23 16:56          
3 ملفات 308 بايت  
724 325 بايت متاحين

مجلة الأوامر في Linux