pgcli - Postgres command line interface
A CLI for working with Postgres databases. Ships with auto-completion and syntax highlighting.
Related cards:
PostgreSQL: Expanded display and other command line features
One useful postgres command I stumbled upon recently was \x
. It gives you an expanded display which allows you to actually read the results of your select * from
queries. The link below describes a few more useful techniques and commands.
davetron5000/methadone - GitHub
Framework to write command-line apps in Ruby. Comes with a nice way of processing parameter options, some utility classes and Cucumber steps for testing your CLI app.
docopt: A promising command line parser for (m)any language
docopt helps you define interface for your command-line app, and automatically generate parser for it.
docopt is based on conventions that are used for decades in help messages and man pages for program interface description. Interface descri...
Manage Linux services on the command line (Ubuntu)
Ubuntu 18.04 uses systemd
to manage services.
There are basically two commands for listing all services and manipulating the state of a certain service: service
and systemctl
:
-
service
manages System V init scripts -
systemctl
control...
Regular Expressions - Cheat Sheet
You can write regular expressions some different ways, e.g. /regex/
and %r{regex}
. For examples, look here.
Remember that it is always a good idea [to matc...
How to: Store multiple Vim commands in macros and recall them
Vim allows recording a batch of commands as a macro. This is handy if you need to do the same things over and over.
Here is how:
- Press
q
to enter macro mode. - Press a letter (not a number!) key to assign a slot to your macro.
- You are n...
Working on the Linux command line: Use the `tree` command instead of repeated `cd` and `ls`
The tree
command will show you the contents of a directory and all it's sub directories as a tree:
>tree
.
├── a
│ ├── file_1.txt
│ └── file_2.txt
└── b
├── c
│ └── even_more.txt
└── more.txt
3 directories, 4 files
I...
Working on the Linux command line: How to bash `cd` with autocorrect
There is an option you can set so that when using the cd
command, small typos are automatically corrected. Add the following to your ~/.bashrc
:
# cd: autocorrect small typos and use best guess
shopt -s cdspell
Example:
cd P...
Linux: How to print PDF files from the command line
Sometimes you may want to print files from the command line, especially when you have lots of them.
You can use lp
for that.
To print a single example.pdf
file on your default printer, simply say:
lp example.pdf
lp
accepts multipl...