Advanced · Organize files
rename: Batch rename based on expression
Syntax
rename expression file…Examples
rename "s/\.txt$/.md/" *.txtUsage and sandbox support
For review only: practice in a real Linux environment, this sandbox does not execute this command. This example uses Perl rename; the syntax of tools of the same name may vary between distributions.
This command is for reference and review, and the simulation terminal does not provide corresponding exercises yet.
Related commands
mkdirCreate directorytouchCreate empty filecpCopy a file or directorymvMove or renamermDelete a file or directoryrmdirDelete empty directoriesfileDetermine file typestatView file propertiesbasenameGet the name at the end of the pathdirnameGet the parent directory pathrsyncSynchronize directories and filesgitManage code versionsmktempCreate a temporary file or directorytruncateAdjust file lengthinstallCopy and set installation permissionsddCopy data in chunkssyncFlush file system cachesha256sumGenerate or inspect SHA-256 digestmd5sumGenerate or inspect MD5 digestcksumCalculate CRC check valuebase64Encode or decode Base64