Premier IT Outsourcing and Support Services within the UK

User Tools

Site Tools


Wiki such as DokuWiki is fussy about how filenames are formatted. Spaces, UPPERCASE are all out. Processing a large number of files and directories can be time intensive so we'll use bash to do it for us.

First we'll change all directories and files with spaces in to have - instead.

find ./ -name "* *" -print0 | sort -rz | while read -d $'\0' f; do mv -v "$f" "$(dirname "$f")/$(basename "${f// /-}")"; done

Then we will rename all the upper case to lower case


Finally we'll remove any files we don't want.

/data/webs/external/dokuwiki/data/pages/base/wiki_file_normalisation.txt · Last modified: 2019/07/09 10:28 by genadmin