Rename command not found when running a script

I'm trying to to execute a script, which uses the command rename.

When I execute it, I get a message rename: command not found. Any ideas?

if [[ -z '$3' ]]; then shopt -s dotglob rename "$EXPRESSION" ./*
else rename "$EXPRESSION" "$3"
fi
2

2 Answers

I just had to install the rename package.

sudo apt install rename
7

My Ubuntu has a man page for rename(1) on fresh install, but running rename gives a CNF error.

The man page style suggests that the command belongs to GNU Core Utilities, but confusingly it actually is rename.ul (Ubuntu Bionic / Disco / Eoan + Debian Buster). This command corresponds to the mysterious rename(1) page.

If you install rename package, the new man page is rename(1p). It's a Perl script, not coreutils.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like