I have managed to setup Tramp to connect to a remote Solaris machine from a Windows machine using plink, which is very nice.

 (setq tramp-default-user "Beginner"
       tramp-default-host "the_host"
       tramp-default-method "plink")

But now I have a host of new problems, which I would assume to be related to the file encoding from the tramp upload:

For example I have edited the .profile and now I get strange error messages like

$>. .profile
bash: $'\r': command not found

How can I configure tramp to format files in a Solaris-friendly way?

Edit: Having unix-encoding the default solves the issue for me

 (prefer-coding-system 'utf-8-unix)

1 Answer 1


Usually, Tramp shall respect encoding of existing files. For new files, you could set the encoding via C-x RET f utf-8-unix RET. You can choose also another coding system, the important point is to append the -unixsuffix. Read also the Emacs manual about coding systems.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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