Tag Archives: terminal

Byobu: the text-based window manager and terminal multiplexer

Byobu is a text-based window manager and terminal multiplexer. This video is a great overview and tutorial on what it can do:

Install in Ubuntu:

$ sudo apt-get install byobu

Install in Mac OS X with brew:

$ brew install byobu

Install in Mac OS X with macports:

$ sudo port install python27 gettext libnewt coreutils gsed
$ curl -L -O https://launchpad.net/byobu/trunk/5.91/+download/byobu_5.91.orig.tar.gz
$ tar xzpf byobu_5.91.orig.tar.gz
$ cd byobu-5.91
$ ./configure
$ make
$ sudo make install


Ref: http://randomfoo.net/2014/01/14/byobu-on-mac-w-macports

Disable automatic locale variables setting in terminal emulator for Mac OS X

Terminal emulators usually send your current locale when conecting to an SSH server. I use Mac OS X in spanish and when I connected to a CentOS server my locale was automatically configured to es_ES.UTF-8 making most command outputs to be in spanish. I prefer using english so I can search error messages easily. Most blogs and web sites (Stackoverflow for example) are in english and I wouldn’t find anything in spanish.

To fix this you just have to disable the automatic locale setting option in your terminal emulator. In Mac OS X Terminal.app it’s in Preferences, Settings, Advance tab, “Set locale environment variables os start up”:


In iTerm it’s in Preferences, Profiles tab, Terminal tab, “Set locale variables automatically”:


Ref: http://serverfault.com/questions/336559/how-to-change-my-commandline-locale-after-centos-decided-to-change-it/373410#373410

See CPU and harddrive temperature from the command line in Ubuntu

Install lm-sensors and then configure it. You’ll be asked to try different ways to interface with the hardware that interfaces with the temperature sensors.

sudo apt-get install lm-sensors
sudo sensors-detect
sudo service module-init-tools start

When finished run this to see the CPU temperatures:


And you’ll see something like this:

Adapter: Virtual device
temp1:        +41.0°C  (crit = +110.0°C)

Adapter: ISA adapter
Core 0:       +33.0°C  (high = +85.0°C, crit = +85.0°C)
Core 1:       +35.0°C  (high = +85.0°C, crit = +85.0°C)

To see the temperature of the hard drives:

sudo apt-get install hddtemp
sudo hddtemp /dev/sda

You’ll see something like this:

/dev/sda: HTS541060G9SA00: 38°C

Ref: http://askubuntu.com/questions/15832/how-do-i-get-the-cpu-temperature

Change your shell prompt

The same way we added colors to the text in terminal application in Mac OS X, you can change the default shell prompt to something more meaning full to your needs. By default it looks something like this:

enekochans-Mac-mini:Users enekochan$

As you can see it is defined as:

"host name":"current working directory" "user name"$

You can change it by modifiying the $PS1 system variable. Those a some of the placeholders but there are a lot more:

  • d – Current date
  • t – Current time
  • h – Host name
  • # – Command number
  • u – User name
  • W – Current working directory (ie: Desktop/)
  • w – Current working directory, full path (ie: /Users/Admin/Desktop)

You can guess that the default value of $PS1 is configured as follows:

EXPORT PS1="h:W u$ "

You can set you own value in ~/.bashrc or ~/.bash_profile.

You can also change the default interactive prompt for a multi-line command which is “>” by changing $PS2 system variable.

Ref: http://www.thegeekstuff.com/2008/09/bash-shell-take-control-of-ps1-ps2-ps3-ps4-and-prompt_command/

Add colors to the text in terminal application in Mac OS X

Just add the following 2 lines to your /etc/profile, ~/.profile or ~/.bash_profile:

export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced

Then to make it work you have to close and open again the terminal application.

Source: StackOverflow.