なんか限りなく XY 問題な気がしますが cat -e /bin/sh コマンドを使って、改行コードを確認したい あなたが確認したいのは /mnt/c/Program Files/nodejs/npm の改行コードであって /bin/sh の改行コードではないはず。 文字化け そりゃバイナリファイルである /bin/sh をコンソールに表示すれば化けているに決まっています。 /bin/sh^M: bad interpreter のメッセージはシェルスクリプトファイルの1行目 shebang (シバンともシェバンとも) の改行コードが CR LF かつ、そのシバンを解釈する何か ( execve カーネル関数と /bin/sh の合わせ技なんだけど) が LF 改行のみ対応の場合に #!/bin/sh<CR><LF> のシバン行を /bin/sh<CR> なファイルを起動すると解釈し、そんな