Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have files that had Slovak characters in them I copied them to my Ubuntu now they have these weird symbols in them, anyone knows how would I remove these character?

share|improve this question
up vote 3 down vote accepted

You can take advantage of the iconv utility, able to convert a string from an character encoding to another, and to also perform transliteration to similar character, when the destination encoding miss them.

The following script will rename each file passed on the command line to an ascii version of the same name. Modify the variable input_enc if needed, and run with --no-test as first parameter to really rename.



if [[ $1 == '--no-test' ]]; then
  echo "This is a simulation"
  echo "run with --no-test as first parameter to really rename"

normalize() {
  local f="$1"
  echo "$f" | iconv -f "$input_enc" -t ASCII//TRANSLIT

for f; do
  g="$(normalize "$f")"
  if ((test)); then
      echo mv -i "$f" "$g"
      mv -i "$f" "$g"
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.