Category Archives: CLI

Command line tips, tricks, and shortcuts

Bag of useful Bash aliases and functions

Here are a number of assorted aliases and functions for Bash that I’ve made in the last few months and found to be useful. Enjoy!

Posted in CLI | Tagged , , , | 6 Comments

Counting columns in a CSV from the CLI on Linux

In wrangling some DB exports recently I needed the number of columns in multiple CSVs. It’s easy enough to just open them in OpenOffice and check the final column number, but I wanted a CLI utility. I even entertained some … Continue reading

Posted in CLI | Tagged , , | Leave a comment

Handy tips for bash scripting: screen reminder and logging

Often I find myself writing simple wrapper scripts for long-running tasks, like migrating a database or performing some repair or optimization process. I mainly want to ensure proper logging is kept in order to determine how long each step takes … Continue reading

Posted in CLI | Tagged , , , | 7 Comments

Improved random password generator script

[EDIT, 2010-11-10:] After being kindly corrected by Chris Jones, I recommend instead using a readily available utility that is more feature rich to boot: pwgen.[/EDIT]

Posted in CLI | Tagged , , | 2 Comments

Dealing with “could not create shared memory segment” from postgres on Ubuntu

After installing postgresql-8.4 from the Ubuntu repos on an Ubuntu 9.10 machine, I received the following when the daemon tried to start up: 1234567 * The PostgreSQL server failed to start. Please check the log output: FATAL:  could not create shared … Continue reading

Posted in CLI | Tagged , , , | 7 Comments