Synology and special characters in folder names

Synology and special characters in folder names

Synology and special characters in folder names don't seem to work well together. I'm from Iceland, and I uploaded a bunch of folders with iso-8859-1 characters in their names. Let's look at a few folders bearing my beautiful name, Ármann. πŸ™‚ That Á is causing issues for Synology's web-client and I can't download them. Let's use this example to learn how to rename folders in Linux. What happens if I try to download a folder with a "?" in its name?

Hmm, that's not working is it? I know what you are thinking, let's just use the "Rename" function that's right below the "Download" option. I like how you think, but if we try to rename it using the web-client, this happens.

Synology and special characters in folder names

I feel like this is marginalizing Icelandic. I know we are small and few people speak it but this isn't okay. I'm just having a laugh of course. πŸ™‚ Let's use this small problem to learn something about Linux. First make sure SSH is enabled on the web client. Go to the Control Panel / Terminal & SNMP / Terminal tab and check Enable SSH service and you can set the port to 22, then click Apply. 22 is the default port for SSH. I personally would chose a different port for security reasons. Pick a port between 49152 and 65535. πŸ˜‰

Now that we have enabled SSH on the Synology box, let's SSH in and fix this issue. If you have never used SSH before I recommend you download Putty. It's the most popular SSH client. SolarWinds also has a free multitab SSH client. You can download Putty here. You can download SolarWinds Solar-Putty here.

Okay, now that you have your client, put in the IP address of your Synology box. You will be asked for a username and password. It's the same username/password that you use to log into the web interface.

After you have successfully logged in, you have to maneuver to the location of the folder you want to fix. Mine is under volume1/Backup/

If you look at the previous picture above you can see that one of the folders is named "?rmann". Let's say we want to rename it "Armann" we would issue the following command.

sudo mv ?rmann/ Armann/

Sudo tells the operating system that you want to execute a command as a super user or another user. You need to escalate your privileges in order to rename the folder. Put in the same password you use to log into the web client. Here is a picture of the me renaming the folder to "Armann".

Synology and special characters in folder names

The mv command is a move command. You can use it to move a file or a whole folder to somewhere else. You can also use it to "move" a file or a folder to the place it's currently in but with a different name. Hence, the rename feature. In the last picture we aren't moving "?rmann" to a different folder, we are using move "?rmann" to "Armann" within the same folder. I hope that makes sense, can be confusing at first since you aren't technically moving it anywhere.

You can run into a few different issues with renaming or moving files/folders in Linux. If there is a space in the file/folder name, you must use quotes or escape every space using the backslash key \.

Let's say I wanted to move the folder "?rmann 1" to "Armann 1".

sudo mv ?rmann\ 1 Armann\ 1

Let's use another example, it's not all about me is it? πŸ™‚

sudo mv ??l?\ 2022\ Fun\ Days July\ 2022\ Fun\ Days

This renames ("moves"), "??l? 2022 Fun Days" to "July 2022 Fun Days".

You could run into another problem. Let's say you were feeling frisky and put a & sign into your folder name. Should be innocent enough but there is a problem. In Linux, the & in the terminal signals that what you type before the & should be run as a background process. Imagine I launch VLC player from the terminal but want to run it as a background process so I can keep using my terminal I would do.

vlc &

There is a folder called "?li & Frikki Abroad". If we did the following it would result in an error.

sudo mv ?li\ &\ Frikki\ Abroad Oli\ &\ Frikki\ Abroad

You did everything right but since the & has a special purpose in Bash, we need to escape that character as well. That way we tell Bash, hey, don't make this a background process. We escape it by putting the backslash in-front of it, as well as behind it to escape the space.

sudo mv ?li\ \&\ Frikki\ Abroad Oli\ \&\ Frikki\ Abroad

Now the folder name is "Oli & Frikki Abroad" and we can download it from the Synology web-client. Synology and special characters in folder names can cause some problems. Please comment down below if I helped or if you have special character issues that I didn't mention and we can figure it out together.

Leave a Reply

Your email address will not be published. Required fields are marked *