diff --git a/README.md b/README.md index 700ac5b..6318584 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ variety of languages and technologies. These are things that don't really warrant a full blog post. These are mostly things I learn by pairing with smart people at [Hashrocket](http://hashrocket.com/). -_378 TILs and counting..._ +_379 TILs and counting..._ --- @@ -163,6 +163,7 @@ _378 TILs and counting..._ - [Aggregate A Column Into An Array](postgres/aggregate-a-column-into-an-array.md) - [Auto Expanded Display](postgres/auto-expanded-display.md) - [Checking The Type Of A Value](postgres/checking-the-type-of-a-value.md) +- [Clear The Screen In psql](postgres/clear-the-screen-in-psql.md) - [Compute Hashes With pgcrypto](postgres/compute-hashes-with-pgcrypto.md) - [Configure The Timezone](postgres/configure-the-timezone.md) - [Constructing A Range Of Dates](postgres/constructing-a-range-of-dates.md) diff --git a/postgres/clear-the-screen-in-psql.md b/postgres/clear-the-screen-in-psql.md new file mode 100644 index 0000000..ee8a45b --- /dev/null +++ b/postgres/clear-the-screen-in-psql.md @@ -0,0 +1,17 @@ +# Clear The Screen In psql + +The `psql` interactive terminal does not have a built-in way of clearing the +screen. What I usually do if I really need the screen cleared is quit, run +`clear` from the shell, and then open a new `psql` session. This is +unnecessary though. Instead, we can use the `\!` command to execute a shell +command, in this case, the `clear` command. + +``` +> \! clear +``` + +This clears the screen in one step and keeps our current session running. + +See the [psql +docs](http://www.postgresql.org/docs/current/static/app-psql.html) for more +details.