NB: THIS IS ALTERING YOUR DATABASE /AND/ YOUR FILENAMES AND CAN POTENTIALLY DESTROY YOUR DATABASE /AND/ FILESTRUCTURE! ONLY ATTEMPT IF YOU UNDERSTAND WHAT THE COMMANDS DO! AND KEEP A BACKUP HANDY! 1) Rename all files from the command line. This replaces all spaces with underscore the current folder and all subdirectories. Execute it repeatedly until no error message appears (the error message appear because folders are renamed before subfolders) ,---- | find . -regex ".* .*" -exec rename \ _ {} \; `---- Find searches for all files in the current directory (.) and it's subdirectories matching the regular expression ".* .*, which means a filename containing any character (.*) followed by a space and then followed by any character. On these files, it executes for each (-exec) the command rename that looks for spaces (\ ) (This is backslash followed by a space, the backslash are used to make the shell interpret the space literally, otherwise it will be ignored) and replaces it by underscore (_) on all the files found ({}). 2) Start sqlite3 in a shell (insert your db path!) ,---- | sqlite3 /path/to/digikam.db `---- This starts sqlite3 and opens the database given as argument (/path/to/digikam.db) 3) Replace space with underscore in the database ,---- | update albums set | relativePath= replace(relativePath, " ", "_") | where | relativePath like "% %"; `---- This queries the "albums" table in the database and replaces spaces in the "relativePath" column, in "relativePath" which contains space (actually, I guess the 'where' statement can be skipped as the 'replace' statement only works on spaces anyhow!) 4) Done! Start digikam and find nicely renamed albums.