---
title: "Find and replace in a large file"
date: "2009-05-27"
path: "/39-find-and-replace-in-a-large-file.html"
section: "/ramblings"
aliases:
  - "/39"
  - "/39-find-and-replace-in-a-large-file"
  - "/39.html"
  - "/ramblings/39-find-and-replace-in-a-large-file.html"
---

I have a 2Gb database dump that needed the database name changing (remember trailing slash):

```
cat sql_file | sed 's/olddbname/newdbname/'
```

and to check that it's complete:

```
grep olddbname sql_file
```
