Since Apache 2.4, all files in /etc/apache2/sites-available and sites-enabled have to be named with the ending .confNow on my server I have a lot of these files, renaming the files in sites-available is easy:for i in /etc/apache2/sites-available/*; do   if [[ $i != *.conf ]]; then    mv -v $i $i.conf;   fidoneBut how can I rename all of their links in sites-enabled with one command?
batch-rename all config file endings to conform to apache 2.4
files;rename
Needing only one command is a hard thing to achieve with unix philosophy in mind.On the other hand: you can rule major parts of your world using one-liners.First fix the configuration files in sites-available with the script from the question,  then use the following code to create new symlinks in sites-enabled.cd /etc/apache2/sites-enabledfind . -type l -ls \| awk '{print $13 .conf ->  $11 .conf}' \| mmv -s -nThis uses your existing links and creates new ones with .conf appended to both, source and destination. mmv -n is the dry run that only shows what would have happened.  If you are satisfied with the results,  run again without -nThen after you've run mmv without -n, remove the old dangling symlinks withfind -L /etc/apache2/sites-enabled -type l -delete