Question: I have been trying to manipulate a file using `tr` and have a task on removing all punctuation in one file and moving the contents into another.

```
cat file1 | tr --delete [:punct:] | cp file1 file2

```

When this command is used I'm returned with a preview of the file with no punctuation but when I look at `file2`, all the punctuation is still there.

Is there something I'm doing wrong?

Answer: 
You aren't changing `file1`, so the last `cp` just copies the old file. `cp` doesn't take input from `stdin` either, so you're not saving that translated output.

You can resolve this by piping your `tr` output directly into `file2` with a `>` redirect.

```
tr --delete '[:punct:]' < file1 > file2

```

Note that I've also removed the [useless use of cat](https://stackoverflow.com/questions/11710552/useless-use-of-cat).
Looks like you need a redirect rather than a pipe. That last command is not reading stdio, just copying the original file1 to file2. Try:

```
cat file1 | tr --delete [:punct:] > file2

```