Category Archives: bash

datsize, simple command line row and column count

Lately I've been working with lots of data files with fixed rows and columns, and have been finding myself doing the following a lot: Getting the row count of a file, twarnock@laptop:/var/data/ctm :) wc -l lda_out/final.gamma 3183 lda_out/final.gamma twarnock@laptop:/var/data/ctm :) … Continue reading

Posted in bash, shell tips | Comments Off on datsize, simple command line row and column count

vim and screen, automagic titles

Previously, I discussed using multiuser screen so that I could concurrently access a shared screen session across multiple remote hosts (from work, from home, from my phone, etc). I would like to augment screen such that the titles would always … Continue reading

Posted in bash, shell tips, vim | Comments Off on vim and screen, automagic titles

multiuser screen

Previously, I discussed using GNU screen as a window manager. I would like to access my screen session concurrently from multiple hosts (say, at work, at home, and even remotely on my phone). I would also like to define default … Continue reading

Posted in bash, shell tips | Comments Off on multiuser screen

chaining ssh tunnels

Imagine you're working within a private home network and need to connect to an Oracle database within a corporate network accessible only through a bastion host hidden within the corporate network. Odd as that sounds, it's a typical network configuration, … Continue reading

Posted in bash, shell tips, ssh | Comments Off on chaining ssh tunnels

screen and screenrc

I would like to use GNU screen as a window manager. By default screen seems like little more than a persistent shell (that you can resume even after logging out). By itself, this is incredibly useful if you wish to … Continue reading

Posted in bash, shell tips | Leave a comment

nohup &

I would like to run a script in the background and to keep running even after I log out. To run a command or script in the background use an ampersand, e.g., # ./long-running-script.sh & This is equivalent to suspending … Continue reading

Posted in bash, shell tips | Leave a comment

smiley shell prompt, or frown

I've been using the following command prompt for years server ~/dir :) whoami victor server ~/dir :) badcommand -bash: badcommand: command not found server ~/dir :( echo sorry sorry server ~/dir :) It's a smiley emoticon, but only when the … Continue reading

Posted in bash, shell tips | Leave a comment