]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
rename: change "expression" to "substring"
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Tue, 1 Jul 2025 16:01:05 +0000 (18:01 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 2 Jul 2025 08:02:47 +0000 (10:02 +0200)
As rename(1) doesn't uses an expression (like regex or glob) but rather a substring.

misc-utils/rename.1.adoc
misc-utils/rename.c

index b8ea2bfdf662edb4f92f620bcbe921ac575fd54a..fc7df4f1c2374a151f44ad083f344747a09cbce7 100644 (file)
@@ -20,11 +20,11 @@ rename - rename files
 
 == SYNOPSIS
 
-*rename* [options] _expression replacement file_...
+*rename* [options] _substring replacement file_...
 
 == DESCRIPTION
 
-*rename* will rename the specified files by replacing the first occurrence of _expression_ in their name by _replacement_.
+*rename* will rename the specified files by replacing the first occurrence of _substring_ in their name by _replacement_.
 
 == OPTIONS
 
@@ -38,10 +38,10 @@ Show which files were renamed, if any.
 Do not make any changes; add *--verbose* to see what would be made.
 
 *-a*, *--all*::
-Replace all occurrences of _expression_ rather than only the first one.
+Replace all occurrences of _substring_ rather than only the first one.
 
 *-l*, *--last*::
-Replace the last occurrence of _expression_ rather than the first one.
+Replace the last occurrence of _substring_ rather than the first one.
 
 *-o*, *--no-overwrite*::
 Do not overwrite existing files. When *--symlink* is active, do not overwrite symlinks pointing to existing targets.
@@ -57,9 +57,9 @@ The renaming has no safeguards by default or without any one of the options *--n
 
 == EDGE CASES
 
-If the _expression_ is empty, then by default _replacement_ will be added to the start of the filename. With *--all*, _replacement_ will be inserted in between every two characters of the filename, as well as at the start and end.
+If _substring_ is empty, then by default _replacement_ will be added to the start of the filename. With *--all*, _replacement_ will be inserted in between every two characters of the filename, as well as at the start and end.
 
-Normally, only the final path component of a filename is updated. (Or with *--symlink*, only the final path component of the link.) But if either _expression_ or _replacement_ contains a _/_, the full path is updated. This can cause a file to be moved between folders. Creating folders, and moving files between filesystems, is not supported.
+Normally, only the final path component of a filename is updated. (Or with *--symlink*, only the final path component of the link.) But if either _substring_ or _replacement_ contains a _/_, the full path is updated. This can cause a file to be moved between folders. Creating folders, and moving files between filesystems, is not supported.
 
 == INTERACTIVE MODE
 
index bb2e3103dba8eb61f8444201caa3cedd917e90e9..d7bf4c5d7f867f2235585a030a94428b222abe76 100644 (file)
@@ -251,7 +251,7 @@ static void __attribute__((__noreturn__)) usage(void)
        FILE *out = stdout;
        fputs(USAGE_HEADER, out);
        fprintf(out,
-             _(" %s [options] <expression> <replacement> <file>...\n"),
+             _(" %s [options] <substring> <replacement> <file>...\n"),
                program_invocation_short_name);
 
        fputs(USAGE_SEPARATOR, out);