1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-05 08:08:02 +00:00

Add Clear The Screen In psql as a postgres til

This commit is contained in:
jbranchaud
2016-03-30 13:59:17 -05:00
parent aa1eb0fcd9
commit 2d09107602
2 changed files with 19 additions and 1 deletions

View File

@@ -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.