# Removing ^M Line Endings from Multiple Files

Use dos2unix to convert Windows line endings in individual files or a batch of Lua source files.

> Files copied directly from Windows to Linux or macOS may show `^M` at the ends of lines in `git diff`. Windows line endings use two characters, `\r\n`.

## Install dos2unix

Ubuntu or Debian:

```
sudo apt-get install dos2unix
```

CentOS:

```
sudo yum install dos2unix
```

macOS:

```
brew install dos2unix
```

## Convert one file

```
dos2unix filename
```

## Convert multiple files

The original example finds Lua files and passes them to `dos2unix`:

```
find ./ -name *.lua | xargs dos2unix
```