November 17, 2023

Prepend multiple files with a pattern with the command line with Bash

For example:

$ for f in * ; do mv -- "$f" "PRE_$f" ; 

will prepend all files in the current directory with PRE_.

I use Bash because I have not figured how to prepend files with the utility rename.ul, let me know if you do.

See also:


personal computing command-line interface (cli) gnu linux trisquel shell literacy office applications wiki bash text processing

No affiliate links, no analytics, no tracking, no cookies. This work © 2016-2024 by yctct is licensed under CC BY-ND 4.0 .   about me   contact me   all entries & tags   FAQ   GPG public key

GPG fingerprint: 2E0F FB60 7FEF 11D0 FB45 4DDC E979 E52A 7036 7A88