Linux command
rename 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
rename
tldr perl-rename
Example
tldr rename.util
说明
rename is a command for batch renaming files. Two major implementations exist: The Perl rename (also called prename or rename.ul) uses Perl regular expressions for powerful pattern matching. It is common on Debian-based systems. The util-linux rename uses simple string substitution. It replaces the first occurrence of a string in each filename. Common on Red Hat-based systems. Check which version is installed with rename --version or file $(which rename).
FAQ
What is the rename command used for?
rename is a command for batch renaming files. Two major implementations exist: The Perl rename (also called prename or rename.ul) uses Perl regular expressions for powerful pattern matching. It is common on Debian-based systems. The util-linux rename uses simple string substitution. It replaces the first occurrence of a string in each filename. Common on Red Hat-based systems. Check which version is installed with rename --version or file $(which rename).
How do I run a basic rename example?
Run `tldr perl-rename` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
Where can I find more rename examples?
This page includes 2 examples for rename, plus related commands for nearby Linux tasks.